linkedin / linkedin/css-blocks

State namespace alias

Open
#97 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

@css-blocks/core enhancement under consideration
Dominant language
TypeScript
Stars
6.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

The state namespace should be something that can be aliased according to dev/team preferences as an authoring convenience.

```css
@namespace s url(http://css-blocks.com/state);
:scope[s|active] { font-weight: bold; }
```

We should also allow states from a block (which are element names in selectors) to have a namespace declared:

```css
@block-reference theme|button from "design-system/button.block.scss";
@namespace s url(http://css-blocks.com/state);
:scope[s|active] { font-weight: bold; font-weight: resolve("theme|button[s|clicked]")}
```

In reference to https://github.com/css-blocks/css-blocks/issues/96, this would allow us to have a way of making a reference to a collection of blocks:

@block-reference theme|* from "design-system/all.block.scss";

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

No files or tests are named. Start by reading the requested syntax here and the referenced issue #96, then trace how namespaces, block references, and state selectors are currently handled. Done means aliases work for the state namespace and namespaced states from referenced blocks support both selectors and resolve() references.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.