cssinjs / cssinjs/css-vendor

Method supportedValue should support !important property.

Open
#214 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
67
Forks
21
PR merge metrics
No merged PRs in 30d

Description

```js
it( 'should support !important property (solid 1px red)', () => {
expect( supportedValue( 'border', 'solid 1px red !important' ) ).to.be( 'solid 1px red !important' );
} );

it( 'should support !important property (1px solid red)', () => {
expect( supportedValue( 'border', '1px solid red !important' ) ).to.be( '1px solid red !important' );
} );
```

I added these two test cases for `supportedValue` method, and got the output as follow:

```
✖ should support !important property (solid 1px red)
✔ should support !important property (1px solid red)
```

```
✖ should support !important property (solid 1px red)
Chrome 86.0.4229.3 (Mac OS 10.15.6)
Error: expected false to equal 'solid 1px red !important'
at Assertion.assert (webpack://cssvendor/node_modules/expect.js/index.js:96:13 <- tests.webpack.js:8:10305)
at Assertion.be.Assertion.equal (webpack://cssvendor/node_modules/expect.js/index.js:216:10 <- tests.webpack.js:8:11808)
at Assertion. [as be] (webpack://cssvendor/node_modules/expect.js/index.js:69:24 <- tests.webpack.js:8:9695)
at Context. (webpack://cssvendor/src/supported-value.test.js:83:81 <- tests.webpack.js:29:255519)
```

This issue makes using `1px solid red !important` and `solid 1px red !important` has different result in `jss`. To support `!important` property or at least to provide same result with these two type of format.

I can send a pull request for this if you think it makes sense.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.