Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 671 Bytes

File metadata and controls

30 lines (22 loc) · 671 Bytes

CSS inherit function

It has a ton of potential to revolutionize how we use design tokens in components and UI libraries today. — Lea Verou

Use Cases

Nested indentation:

--indent: calc(inherit(--indent, 0) + 1);

Overridable design token defaults:

/*
Before:
:host {
  --default-primary-color: blue;
}
:host {
  background-color: var(--primary-color, var(--default-primary-color));
}
*/

--primary-color: inherit(--primary-color, blue);