Skip to content

Commit

Permalink
parse at-rule prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
tbela99 committed Aug 13, 2023
1 parent 9350eae commit 1ee6b18
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/specs/angle.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* generate from test/specs/block.spec.ts */
import {expect as f} from '../../node_modules/@esm-bundle/chai/esm/chai.js';
import {parse, render} from '../../dist/index.js';

describe('Parse angle', function () {

it('angle #1', function () {
return parse(`.transform { transform: rotate(12deg, 1.57rad, 100grad); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.transform {
transform: rotate(12deg,1.57rad,100grad)
}`));
});
});
29 changes: 29 additions & 0 deletions test/specs/color.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* generate from test/specs/block.spec.ts */
import {expect as f} from '../../node_modules/@esm-bundle/chai/esm/chai.js';
import {parse, render} from '../../dist/index.js';

describe('Parse color', function () {

it('hsl #1', function () {
return parse(`.hsl { color: hsl(195, 100%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hsl {
color: #00bfff
}`));
});

it('hsl #2', function () {
return parse(`.hsl { color: hsla(195, 100%, 50%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hsl {
color: #00bfff80
}`));
});
it('hwb #3', function () {
return parse(`.hwb { color: hwb(195, 0%, 0%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hwb {
color: #00bfff
}`));
});

it('hwb #4', function () {
return parse(`.hwb { color: hwb(195, 0%, 0%, 50%); }`).then(result => f(render(result.ast, {minify: false}).code).equals(`.hwb {
color: #00bfff80
}`));
});
});

0 comments on commit 1ee6b18

Please sign in to comment.