Comments (3)
I have no such plans. While @webref/css
offers a source of syntax data that could potentially enhance dictionaries like mdn/data
, it cannot fully replace them. Utilizing @webref/css
presents several challenges:
- Specification versions: Multiple levels (versions) exist for many specs. While subsequent levels sometimes merely extend their predecessors, allowing for the use of the latest version, this isn't always the case. Certain specifications might undergo deletions or modifications. Consequently, a syntax that is valid in one version might become obsolete in another, even if the older version remains prevalent and browser-supported. It's worth noting that browsers occasionally support intermediate syntax states, which once appeared in a specification but were not retained in its final version.
- Draft specs: The inclusion of syntaxes from draft specs is debatable. Even if a feature is supported by multiple browsers, its corresponding spec might still be in draft or another non-REC status. Conversely, some features might implemented by browser vendors in their initial draft state without without an alignment to the latest state for a long time.
- Syntax details in prose:
@webref/css
extracts syntaxes from definition sections. However, certain syntax nuances are elaborated in prose, necessitating manual extraction, which isn't currently facilitated. - Proprietary syntaxes: vendor-prefixed or proprietary syntaxes, despite their widespread use in development, don't feature in official specs.
In essence, while @webref/css
can validate how CSS aligns with the present or upcoming specification states, CSSTree's goal is to validate CSS against versions that browsers currently support, or have supported in the past. In this context, mdn/data
, despite its imperfections, aligns more closely with this objective.
Absolutely, the merits of @webref/css
are acknowledged, and it indeed addresses specific needs effectively. Nonetheless, for a more holistic approach to CSS validation, the creation of a distinct, comprehensive dictionary is advocated. This resource would amalgamate the strengths of @webref/css
and a meticulously curated, manually updated support matrix akin to caniuse
(though caniuse
is not directly applicable in this context since it doesn't provide syntaxes).
This proposed dictionary would offer a consolidated, dynamic resource that integrates the detailed, spec-aligned syntax data from @webref/css
with real-world browser support information. It would bridge the gap between theoretical specification adherence and practical, on-the-ground implementation, ensuring developers have access to a robust, accurate, and up-to-date resource for CSS validation. Currently mdn/data
in this role.
from csstree.
I agree with your feedback.
I've been using @webref/css
in various packages as a source of data and found that it frequently adds new and broken syntax definitions only to remove these again a few days later. Because it reflects the main branch on csswg-drafts there is too much happening there that will (or should) never ship in browsers.
I never used it as a production dependency and after gaining some experience with it I would advise against this. It is a very good resource in build scripts, or for more manual data scraping. Things where eventually a human still interprets the data.
My main concern was seeing that mdn/data
is considered to be deprecated and that @webref/css
is listed as the replacement.
I don't think @webref/css
can be a replacement for mdn/data
in its current form.
This issue is answered for me and can be closed.
from csstree.
Almost forgot...
Thank you @lahmatiy for the detailed answer 🙇
Very valuable insights.
from csstree.
Related Issues (20)
- `oklch()` support HOT 6
- csstree.lexer.matchProperty doesn't give an error on "filter" property with "blur(4px)empx"
- `font-weight` descriptor in `@font-face` doesn't allow two values HOT 2
- Support hask mark next to curly braces in CSS grammar
- Parsing invalid input with specified base location doesn't work properly HOT 1
- Customizable tokenizer in the fork API
- SyntaxError: ")" is expected HOT 2
- consider dropping some builds
- @import rule with supports() and/or layer() parsed as Raw HOT 3
- Do you have plans to replace mdn-data with other packages? HOT 2
- Imported Object.prototype conflict with csstree module! HOT 1
- Value Definition Syntax parser fails on "<an+b>" HOT 2
- Throws if the value of :lang() pseudo-class is quoted
- Nested attribute selector without & is parsed as raw
- How to do getComputedStyle for a list of classes?
- Value Definition Syntax parser rejects whitespaces in multipliers
- New sizing value stretch fails validation HOT 1
- Function node type miss in custom css property HOT 2
- Support `@position-try`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csstree.