w3c / w3c/csswg-drafts

[css-cascade-5] Do we need an API that lists the cascade layers in a tree scope?

Open
#7,015 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Closed Deferred Commenter Response Pending css-cascade-5
Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Description

It might be useful if there is an API that returns all the cascade layers of a tree scope as a sorted list or a tree. For example, DevTools might need this (source: https://twitter.com/kilianvalkhof/status/1484568350504140804?s=20)

However, for the same purpose, Chrome DevTools doesn't need a public web API. Instead, it retrieves information via Chrome DevTools Protocol, which is also a public API.

So while a layer-listing API seems good on its own, I'm not sure about the exact use cases, and therefore not sure about what the exact result format it should use. (I tried to draft something here)

So I'm opening this issue to collect ideas and see if we should introduce such an API.

@mirisuzanne

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed layer-listing API in the linked gist and the issue's discussion of DevTools use cases and result formats. Compare the public web API idea with Chrome DevTools Protocol. Done means reaching agreement on concrete use cases and whether an API, including its output shape, should be introduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.