Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use page type instead of tags for CSSSyntax macro #7290

Merged
merged 1 commit into from Oct 10, 2022

Conversation

wbamberg
Copy link
Collaborator

@wbamberg wbamberg commented Oct 4, 2022

Summary

Use page-type instead of tags for the CSSSyntax macro.

We recently defined and added page types for pages under Web/CSS: mdn/content#15540 .

One of the purposes of this was to replace tags for describing the type of thing a page documented. @teoli2003 observed that it would be a good idea to start using page types as soon as possible, as this gives us an incentive to keep them maintained.

So this PR updates the CSSSyntax macro to use page types instead of tags.

Screenshots

UI should look exactly the same, except in places where tags and page-type don't agree, in which case page-type should be more accurate.

How did you test this change?

Ran yarn dev, looked at some Web/CSS pages. Really what we are testing is that the macro can figure out how to get the formal syntax from webref for each of the four kinds of thing: CSS shorthand properties, CSS properties, CSS types, CSS functions.

Shorthand properties

http://localhost:3000/en-US/docs/Web/CSS/border#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/grid#formal_syntax

Properties

http://localhost:3000/en-US/docs/Web/CSS/justify-content#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/margin-top#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/mask-clip#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/opacity#formal_syntax

Types

http://localhost:3000/en-US/docs/Web/CSS/color_value#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/gradient#formal_syntax

Functions

http://localhost:3000/en-US/docs/Web/CSS/clamp#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/min#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/max#formal_syntax
http://localhost:3000/en-US/docs/Web/CSS/transform-function/translateY#formal_syntax

@github-actions github-actions bot added the macros tracking issues related to kumascript macros label Oct 4, 2022
Copy link
Member

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really excited about this!

And I find the code of the macro much more readable!

(We may be able to remove Tags and simplifies the platform very soon!)

Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 great!

@wbamberg
Copy link
Collaborator Author

wbamberg commented Oct 5, 2022

Thanks @fiji-flo ! Can we merge this, then?

@wbamberg
Copy link
Collaborator Author

I'm merging this, because it has ticks and I'd like to write another PR to add support for at-rule formal syntax, given #4656 (comment).

@wbamberg wbamberg merged commit 3b27ae7 into mdn:main Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macros tracking issues related to kumascript macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants