Only enable shadow lookup if shadowLookup experiment is enabled
This commit is contained in:
parent
cfe492220c
commit
24e1385aca
2 changed files with 9 additions and 2 deletions
|
|
@ -202,7 +202,12 @@ test('you can apply utility classes that do not actually exist as long as they w
|
|||
.foo { margin-top: 1rem; }
|
||||
`
|
||||
|
||||
return run(input).then(result => {
|
||||
const config = {
|
||||
...defaultConfig,
|
||||
experiments: { shadowLookup: true },
|
||||
}
|
||||
|
||||
return run(input, config).then(result => {
|
||||
expect(result.css).toEqual(expected)
|
||||
expect(result.warnings().length).toBe(0)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -59,7 +59,9 @@ function findClass(classToApply, classTable, shadowLookup, onError) {
|
|||
export default function(config, generatedUtilities) {
|
||||
return function(css) {
|
||||
const classLookup = buildClassTable(css)
|
||||
const shadowLookup = buildShadowTable(generatedUtilities)
|
||||
const shadowLookup = _.get(config, 'experiments.shadowLookup', false)
|
||||
? buildShadowTable(generatedUtilities)
|
||||
: {}
|
||||
|
||||
css.walkRules(rule => {
|
||||
rule.walkAtRules('apply', atRule => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue