Replies: 3 comments 2 replies
-
I think this is a good idea. If we have a dedicated page for a type, we should link to it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yeh I agree - making the formal syntax shorter for property pages is a big win imo. Would there (or is there) a way to find out any types we don't document? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I filed a PR for the first piece of this: mdn/yari#6618 - this just adds support for CSS types. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just landed an upgrade (I hope) to the way we render formal syntax for CSS properties.
The way this currently works is: it fetches (from webref) the syntax for the property, and all the syntaxes defined in the specs for all the values that that property can take, recursively (i.e. where a value is defined in terms of other values).
It then writes out all these syntaxes. So for instance, for https://developer.mozilla.org/en-US/docs/Web/CSS/background-image#formal_syntax , we include not only the syntax for
background-image
, but also syntax for the<gradient>
type, and then recursively for the<color>
type..If a value doesn't have a syntax in webref, it makes a link to MDN, expecting us to have a page for that type. For example, we do this for
<length>
.I think we should adjust this a little. In particular, I think we should:
include a CSS formal syntax section in the pages for some of our more complex types and functions, including for example
<color>
and<gradient>
.for these types and functions, instead of listing their syntax in the pages for properties that use them, instead link from those property pages to the type page, as we currently do for types that don't have a defined syntax in webref. This would mean, for example, that rather than https://developer.mozilla.org/en-US/docs/Web/CSS/background-image#formal_syntax embedding the syntax for
<gradient>
, we instead link to https://developer.mozilla.org/en-US/docs/Web/CSS/gradient, and list its syntax there.I think there would be a few benefits to this:
people looking at the page for the type would be able to see its formal syntax
the formal syntax for the property would be shorter, giving more of an overview, while still enabling people to get all the details if they needed it
it would help emphasise the commonality across many properties: that is, the fact that
<color>
is always specified the same way, so any time a property can accept a<color>
, the details of that part of he syntax are always the same.Beta Was this translation helpful? Give feedback.
All reactions