Remove dependency on postcss-functions (#4317)

* Write postcss-functions ourselves

* Add test for nested theme calls

* Remove unused import
This commit is contained in:
Adam Wathan 2021-05-11 14:33:05 -04:00 • committed by GitHub
parent 522787ac41
commit 5ebe5e8309
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 86 additions and 19 deletions

View file

@ -68,6 +68,27 @@ test('a default value can be provided', () => {
})
})
test('the default value can use the theme function', () => {
const input = `
.cookieMonster { color: theme('colors.blue', theme('colors.yellow')); }
`
const output = `
.cookieMonster { color: #f7cc50; }
`
return run(input, {
theme: {
colors: {
yellow: '#f7cc50',
},
},
}).then((result) => {
expect(result.css).toEqual(output)
expect(result.warnings().length).toBe(0)
})
})
test('quotes are preserved around default values', () => {
const input = `
.heading { font-family: theme('fontFamily.sans', "Helvetica Neue"); }