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

Added alias table for deprecated css properties #552

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jaytaph
Copy link
Member

@jaytaph jaytaph commented Aug 17, 2024

Fixes #551

  • sorting properties alfabetically,
  • added an alias table so we can fetch the syntax from the deprecated properties
  • hardcoded skipping some properties (stop-color, stop-opacity)

Comment on lines +45 to +48
sort.Slice(webrefData.Properties, func(i, j int) bool {
return webrefData.Properties[i].Name < webrefData.Properties[j].Name
})

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we want to sort the properties alphabetically, it might make more sense to sort them after its spec.

Copy link
Member Author

Choose a reason for hiding this comment

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

how do you mean?

Copy link
Member

Choose a reason for hiding this comment

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

When you are looking for a specific prop, and it's syntax, the computed props might be nearer then, since they are all defined in the same spec.

I guess for expanded props it isn't really an issue, since of grid or mask, they all also start with grid- or mask.


for wdp := range webrefData.Properties {
if webrefData.Properties[wdp].Name == alias {
property.Syntax = webrefData.Properties[wdp].Syntax
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't straight up copy the syntax, I think it makes sense to also add a property that it is an alias and which prop it aliases. So we can copy the value in the matching part directly to the aliased prop.

So when we have -webkit-mask, we copy the property to mask in the matcher. Basically at the same point where we resolve shorthands.

This makes it easier in the mask implementation, since we only need to check for mask-clip and not also -webkit-mask-clip

Copy link
Member Author

Choose a reason for hiding this comment

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

that might make sense

Copy link
Member Author

Choose a reason for hiding this comment

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

i'll move the aliases to a separate "alias" listing, and pick them up in the matcher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add aliased properties
2 participants