@codecademy/gamut-styles
21.2.021.2.1-alpha.e787e5.0
dist/variance/config.js~
dist/variance/config.jsModified+12−1
Index: package/dist/variance/config.js
===================================================================
--- package/dist/variance/config.js
+++ package/dist/variance/config.js
@@ -449,11 +449,22 @@
},
resolveProperty: getPropertyMode,
transform: transformSize
},
+ // `scale: 'zIndexes'` resolves token names (e.g. `zIndex="modal"`) to `var(--zIndexes-*)`.
+ // `allowRawValue` keeps the numeric/global escape hatch (e.g. `zIndex={550}`,
+ // `zIndex={zIndexes.foreground + 1}`) that scaled props otherwise reject.
zIndex: {
- property: 'zIndex'
+ property: 'zIndex',
+ scale: 'zIndexes',
+ allowRawValue: true
},
+ // Companion to `zIndex`, deliberately unscaled: `isolation: 'isolate'` establishes a local
+ // stacking context so descendant `zIndex` values are scoped to this element, without the
+ // `position` change or z-index lift that `position: relative` + a `zIndexes` token would add.
+ isolation: {
+ property: 'isolation'
+ },
opacity: {
property: 'opacity'
}
};