Skip to content

Commit

Permalink
rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
cdoublev committed May 11, 2021
1 parent dac15bb commit dc13d57
Show file tree
Hide file tree
Showing 39 changed files with 1,607 additions and 713 deletions.
12 changes: 3 additions & 9 deletions lib/CSSStyleDeclaration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ describe('CSSStyleDeclaration', () => {
style.color = 'rgba(0,0,0,0)';
expect(style.color).toEqual('rgba(0, 0, 0, 0)');
style.color = 'rgba(5%, 10%, 20%, 0.4)';
expect(style.color).toEqual('rgba(12, 25, 51, 0.4)');
expect(style.color).toEqual('rgba(13, 26, 51, 0.4)');
style.color = 'rgb(33%, 34%, 33%)';
expect(style.color).toEqual('rgb(84, 86, 84)');
expect(style.color).toEqual('rgb(84, 87, 84)');
style.color = 'rgba(300, 200, 100, 1.5)';
expect(style.color).toEqual('rgb(255, 200, 100)');
style.color = 'hsla(0, 1%, 2%, 0.5)';
Expand All @@ -199,7 +199,7 @@ describe('CSSStyleDeclaration', () => {
style.color = 'currentcolor';
expect(style.color).toEqual('currentcolor');
style.color = '#ffffffff';
expect(style.color).toEqual('rgba(255, 255, 255, 1)');
expect(style.color).toEqual('rgb(255, 255, 255)');
style.color = '#fffa';
expect(style.color).toEqual('rgba(255, 255, 255, 0.667)');
style.color = '#ffffff66';
Expand Down Expand Up @@ -610,10 +610,4 @@ describe('CSSStyleDeclaration', () => {
expect(style.getPropertyValue('--foo')).toEqual('');
expect(style.getPropertyValue('--fOo')).toEqual('purple');
});

test('supports calc', () => {
const style = new CSSStyleDeclaration();
style.setProperty('width', 'calc(100% - 100px)');
expect(style.getPropertyValue('width')).toEqual('calc(100% - 100px)');
});
});
Loading

0 comments on commit dc13d57

Please sign in to comment.