-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
58 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { testProp } from '../../css' | ||
|
||
test('with fallback color', () => { | ||
testProp('background-color:$(primary,white/.1)', 'background:var(rgb(0 0 0),rgb(255 255 255/.1))', { | ||
variables: { primary: '#000000' } | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,34 @@ | ||
import { testCSS } from '../../css' | ||
import config from '../../config' | ||
|
||
// it('uses with $ function', () => { | ||
// testCSS('font-weight:$(fontWeight-thin)', '.font-weight\\:\\$\\(fontWeight-thin\\){font-weight:100}') | ||
// }) | ||
|
||
// test('variables', () => { | ||
// testCSS('m:$(spacing-x1)', '.m\\:\\$\\(spacing-x1\\){margin:1rem}', { | ||
// variables: { | ||
// spacing: { x1: 16, x2: 32 }, | ||
// } | ||
// }) | ||
// }) | ||
it('uses with $ function', () => { | ||
testCSS('font-weight:$(fontWeight-thin)', '.font-weight\\:\\$\\(fontWeight-thin\\){font-weight:100}') | ||
}) | ||
|
||
test('negative variables', () => { | ||
testCSS('m:$(-spacing-x1)', '.m\\:\\$\\(-spacing-x1\\){margin:-1rem}', { | ||
test('rule variables', () => { | ||
testCSS('font:sm', '.font\\:sm{font-size:1rem}', config) | ||
testCSS('font-size:sm', '.font-size\\:sm{font-size:1rem}', config) | ||
testCSS('ls:wide', '.ls\\:wide{letter-spacing:0.025em}', config) | ||
testCSS('letter-spacing:wide', '.letter-spacing\\:wide{letter-spacing:0.025em}', config) | ||
testCSS('shadow:x2', '.shadow\\:x2{box-shadow:0rem 25px 50px -12px rgb(0 0 0 / 25%)}', config) | ||
testCSS('inset:sm|md|md|sm', '.inset\\:sm\\|md\\|md\\|sm{inset:0.625rem 1.25rem 1.25rem 0.625rem}', config) | ||
testCSS('b:inputborder', '.b\\:inputborder{border:0.125rem solid rgb(209 26 30)}', config) | ||
testCSS('content:delimiter', '.content\\:delimiter{content:"123"}', { | ||
variables: { | ||
spacing: { x1: 16, x2: 32 } | ||
content: { delimiter: '"123"' } | ||
} | ||
}) | ||
}) | ||
|
||
// test('rule variables', () => { | ||
// testCSS('font:sm', '.font\\:sm{font-size:1rem}', config) | ||
// testCSS('font-size:sm', '.font-size\\:sm{font-size:1rem}', config) | ||
// testCSS('ls:wide', '.ls\\:wide{letter-spacing:0.025em}', config) | ||
// testCSS('letter-spacing:wide', '.letter-spacing\\:wide{letter-spacing:0.025em}', config) | ||
// testCSS('shadow:x2', '.shadow\\:x2{box-shadow:0rem 25px 50px -12px rgb(0 0 0 / 25%)}', config) | ||
// testCSS('inset:sm|md|md|sm', '.inset\\:sm\\|md\\|md\\|sm{inset:0.625rem 1.25rem 1.25rem 0.625rem}', config) | ||
// testCSS('b:inputborder', '.b\\:inputborder{border:0.125rem solid rgb(209 26 30)}', config) | ||
// testCSS('content:delimiter', '.content\\:delimiter{content:"123"}', { | ||
// variables: { | ||
// content: { delimiter: '"123"' } | ||
// } | ||
// }) | ||
// testCSS('content:delimiter', '.content\\:delimiter{content:"|"}', { | ||
// variables: { | ||
// content: { delimiter: '"|"' } | ||
// } | ||
// }) | ||
// testCSS('b:input', '.b\\:input{border:0.0625rem solid rgb(0 0 0)}', { | ||
// variables: { | ||
// border: { | ||
// input: '1|solid|test-70' | ||
// }, | ||
// test: { 70: '#000' } | ||
// } | ||
// }) | ||
// }) | ||
|
||
// it('negative variables', () => { | ||
// testCSS('w:-11x', '.w\\:-11x{width:-3.75rem}', { | ||
// variables: { | ||
// width: { '11x': 60 } | ||
// } | ||
// }) | ||
// }) | ||
testCSS('content:delimiter', '.content\\:delimiter{content:"|"}', { | ||
variables: { | ||
content: { delimiter: '"|"' } | ||
} | ||
}) | ||
testCSS('b:input', '.b\\:input{border:0.0625rem solid rgb(0 0 0)}', { | ||
variables: { | ||
border: { | ||
input: '1|solid|test-70' | ||
}, | ||
test: { 70: '#000' } | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters