-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add matches for CSS features #3709
Comments
@Elchi3 pointed me to https://github.com/ddbeck/browser-compat-data/blob/master/css/properties/transform.json#L143 and I wonder how keywords like FWIW, a lot of this can probably be derived from https://github.com/tidoust/reffy-reports/tree/master/whatwg/css, which contains information scraped from all specs. |
@foolip if it helps, I meant for the matching data to be as not-clever as I could manage. I intended for keywords to be a list of strings that correspond to the use of that feature, rather than keywords in the narrow sense of CSS (or any other specific compat area). For the linked example, I intended for it to be understood as if a CSS declaration uses the |
I see. Do you know who will be using this matching data? I'm curious to look at the concrete code using it, to see if it could be reused elsewhere. Understanding how the data is used also helps inform how to populate it. |
Reading #3366 would probably be the best place to start. The matching data in the schema is brand new (merged a week ago), so we don't have examples of its use in the wild yet, but I expect webhint will start using it soon. |
Can you derive anything for this from regexes in TextMate language files? e.g. in VS Code or Atom? |
Also, can we add an attribute to the schema for "Regex explanation"? Right now, these mean nothing to me: ^#[0-9a-fA-F]{4}(?:[0-9a-fA-F]{4})?$ ^([\\d\\w%-]+|calc\\(.+\\))\\s+([\\d\\w%-]+|calc\\(.+\\))\\s+([\\d\\w-]+|calc\\(.+\\))$ For example, Wikidata properties have format as a regular expression, e.g. if you want to restrict the possible values for an ID in a given database to be only numbers, as well as syntax clarification, which is used to explain what the regex is supposed to do, since regex is generally not the most easy-to-read syntax. |
It seems like we should use the
For that one the current
That one at least seems sufficient to me — as far as also serving as an explanation of the regex. But if we wanted something more than that, the CSS spec has prose: https://drafts.csswg.org/css-color/#typedef-hex-color
So the description for that one is:
…which means less to me than the regex does. After looking at https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin#Syntax, it seems like a better description would be something like:
|
It seems to be there's a few points of confusion. People are having trouble understanding:
I tried to capture the use of regexes a little bit in the schema doc. It would help me a lot to know how the docs aren't helping BCD contributors and consumers understand how to make the most of regexes. Along similar lines, the meanings of individual regexes wasn't really considered something that BCD consumers would want to show to human readers, so I'm not really sure how a textual description of a regex would be useful to BCD consumers either. For authors of regexes, I kinda figured the regex test cases would serve as place to show how regexes hint at feature matches. But if those aren't helpful either, that would be good to know. In the last case, yes, bad descriptions are bad. I'd welcome PRs that revise them to be helpfully concise instead of uselessly terse. 😄 |
This has never taken off. We're considering removal in #8945 |
In #3631 we've added
matches
objects to the schema.Both webhint.io and https://github.com/eduardoboucas/compat-report (and probably other BCD data consumers) need
matches
objects to analyze compatibility of CSS features.In eduardoboucas/compat-report#4 @eduardoboucas lists features for which we should have a matches object ("transforms" in his project). I'm opening this issues to track work for adding
matches
to all of the CSS features that need them.I don't know how to prioritize these yet. This is the current list:
animation-direction
background-attachment
background-clip
background-color
background-image
background-origin
background-position-x
background-position-y
background-position
background-repeat
background-size
background
border-bottom-left-radius
border-bottom-right-radius
border-image-repeat
border-image
border-radius
border-top-left-radius
border-top-right-radius
clear
column-count
column-width
columns
flex-basis
flex-grow
float
font-family
font-size
font-variant-alternates
font-variant
font
grid-gap
grid-template-columns
grid-template-rows
list-style-type
list-style
margin-bottom
margin-left
margin-right
margin-top
margin
mask-clip
mask-image
mask-origin
mask-type
mask
order
position
text-align
text-combine-upright
text-decoration-line
text-decoration-style
text-decoration
text-emphasis-position
text-indent
text-orientation
text-overflow
touch-action
transform-origin
transform
transition-property
transition
z-index
The text was updated successfully, but these errors were encountered: