Replies: 1 comment 2 replies
-
So I have no problem having 0 parameters if we can get the data with 100% accuracy, like, say, from a YAML attribute. I don't like when there are guesses or when it adds a dependency (like from So the question is: can we achieve this? If so, fine. If not, I would prefer to have an explicit parameter (like we end doing for |
Beta Was this translation helpful? Give feedback.
-
The current implementation of CSSSyntax takes a parameter naming the thing for which we want to display formal syntax (e.g.
margin
,<color>
,image()
). But the param is optional: if it is omitted (which it almost always is) the macro tries to figure out what the thing is based on the current page.Over in mdn/yari#6618 (comment) , @teoli2003 proposed that we stop doing this, and instead make the parameter mandatory.
I think this is a good idea, mostly because it makes things more explicit and less magical: you get what you ask for instead of having the code work out what you asked for. It's also less fragile and means we could change page titles or slugs without worrying about things like this.
Beta Was this translation helpful? Give feedback.
All reactions