Remove dependency on postcss-functions (#4317)
* Write postcss-functions ourselves * Add test for nested theme calls * Remove unused import
This commit is contained in:
parent
522787ac41
commit
5ebe5e8309
3 changed files with 86 additions and 19 deletions
|
|
@ -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"); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue