Expose theme variables to CSS

This commit is contained in:
Jordan Pittman 2023-06-14 12:11:39 -04:00 • committed by Robin Malfait
parent ba7d3be00e
commit 3c38f0a391
No known key found for this signature in database
GPG key ID: 92F53D68B9041AFE
2 changed files with 5 additions and 1 deletions

View file

@ -23,7 +23,8 @@ export function parseCssConfig(root) {
}
})
theme.remove()
// Allow the variables to be used with var() anywhere in CSS
theme.selector = ':root'
return config
}

View file

@ -32,6 +32,9 @@ test('it does something', () => {
--tw-text-opacity: 1;
color: rgb(250 202 222 / var(--tw-text-opacity));
}
:root {
--colors-potato: #facade;
}
`)
})
})