-
-
Notifications
You must be signed in to change notification settings - Fork 35
Change Request: Track variables on SourceCode #160
Copy link
Copy link
Open
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionenhancementNew feature or requestNew feature or request
Metadata
Metadata
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionenhancementNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Ready to Implement
Environment
HEAD
What problem do you want to solve?
CSS variables are a significant part of modern CSS, and in order to accurately validate property values, each rule now has to track custom properties and see where they're applied in values.
What do you think is the correct solution?
Something similar to the functionality of
eslint-scopefor CSS. I'm not quite sure on the details as the custom property/var()usage is a different paradigm than variables in JS, but something along the lines of asourceCode.customPropertiesmap where the key is the custom property name and the value is an object that tracks both rules where the custom property is set and declarations where the custom property value is read. We may also want to make it easy to get the closest value for that custom property to aid in validation, similar to what I did in #148.Participation
Additional comments
We'd need an RFC for this to ensure we're thinking through the complexities.