Giter Site home page Giter Site logo

Comments (3)

lahmatiy avatar lahmatiy commented on June 2, 2024 2

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.

romainmenke avatar romainmenke commented on June 2, 2024 1

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.

romainmenke avatar romainmenke commented on June 2, 2024 1

Almost forgot...

Thank you @lahmatiy for the detailed answer 🙇
Very valuable insights.

from csstree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.