Skip to content

Commit acc82cf

Browse files
authored
cascade-layers : container is an element specific conditional rule (#610)
1 parent b0e1123 commit acc82cf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

plugins/postcss-cascade-layers/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
### Unreleased
44

55
- Fix broken `@keyframes` in `@layer`.
6-
- Add support for `@container` as a conditional rule.
76

87
### 1.0.5 (July 8, 2022)
98

plugins/postcss-cascade-layers/src/constants.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ export const WITH_SELECTORS_LAYER_NAME = 'csstools-layer-with-selector-rules';
66
export const ANONYMOUS_LAYER_SUFFIX = '6efdb677-bb05-44e5-840f-29d2175862fd';
77
export const IMPLICIT_LAYER_SUFFIX = 'b147acf6-11a6-4338-a4d0-80aef4cd1a2f';
88

9+
// https://drafts.csswg.org/css-cascade-5/#layer-ordering
10+
// Layers that are defined inside of a conditional group rule do not contribute to the layer order
11+
// unless the condition is true or unless the conditional group rule can evaluate differently for different elements in the document.
12+
//
13+
// Since the layer order is global to the document,
14+
// any layers defined inside an element-sensitive conditional group rule need to be accommodated
15+
// when establishing the global layer order, regardless of the rule’s condition.
16+
// Conditions that are global to the document, however (such as @media and @supports) can accommodate such @layer rules conditionally.
917
export const CONDITIONAL_ATRULES = [
1018
'media',
1119
'supports',
12-
'container',
1320
];
1421

1522
export const ATRULES_WITH_NON_SELECTOR_BLOCK_LISTS = [

0 commit comments

Comments
 (0)