w3c / w3c/csswg-drafts

proposal: @require, a "dependent @import", if the required CSS file fails to load, all the declarations in the container file also fail.

Open
#3,032 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-cascade-6 css-cascade-7
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

CSS files can be strongly dependent on other CSS files, it wouldn't make senses to still render based on the declarations if the CSS file they depend on fails to load.

Users would rather even see a completely unstyled document, than see a document which is "half" rendered in a mess.

So sometimes CSS files need to be made "atomic" — either they all succeed, or they all fail.

So I'd like to see something like @require, a "dependent @import" available.

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

The issue identifies no repository files, tests, or implementation entry point; begin by reviewing the CSSWG discussion and the existing CSS import behavior it proposes to change. Done would require an agreed specification for @require and corresponding tests, but neither is defined here.

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
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.