Skip to content

Commit

Permalink
Test: add some tests just to be sure it works
Browse files Browse the repository at this point in the history
  • Loading branch information
JPeer264 committed May 10, 2019
1 parent 08c4e6e commit 1f65e4d
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions test/replace.css.js
Expand Up @@ -418,3 +418,57 @@ test('should not replace css variables properly',
`,
{ ignoreCssVariables: true },
);

test('should replace css variables',
replaceCssMacro,
`
.theme {
--theme-primary: #111;
--theme-secondary: #f0f0f0;
--theme-tertiary: #999;
}
.theme--variant {
--theme-primary: red;
--theme-secondary: white;
--theme-tertiary: black;
}
.box {
color: var(--theme-primary);
background-color: var(--theme-secondary);
font-size: 1.2em;
line-height: 1.4;
width: 100%;
max-width: 400px;
padding: 5px;
border: 1px solid var(--theme-tertiary);
margin: 0 0 20px;
}
`,
`
.d {
--a: #111;
--b: #f0f0f0;
--c: #999;
}
.e {
--a: red;
--b: white;
--c: black;
}
.f {
color: var(--a);
background-color: var(--b);
font-size: 1.2em;
line-height: 1.4;
width: 100%;
max-width: 400px;
padding: 5px;
border: 1px solid var(--c);
margin: 0 0 20px;
}
`,
);

0 comments on commit 1f65e4d

Please sign in to comment.