Closed reme3d2y closed 4 years ago
Thank you for this great plugin.
I want to override custom properties used in a third-party library. I tried to do that with importFrom. But I was surprised to see that the variables were not overridden.
importFrom
Inside this library, one of the components contains the following css rules:
:root { --border-radius: 4px; } .component { border-radius: var(--border-radius); }
I configure the following options:
importFrom: [{ customProperties: { '--border-radius': '100px' }. }]
I expect the border-radius to be 100px. But it remains 4px.
In source code I saw that variables from root have priority over variables from importFrom. Is this correct behavior?
In my opinion, the variables from importFrom should have the maximum priority.
I think those lines should be switched: https://github.com/postcss/postcss-custom-properties/blob/master/src/index.js#L31 https://github.com/postcss/postcss-custom-properties/blob/master/src/index.js#L32
Fixed in https://github.com/postcss/postcss-custom-properties/releases/tag/9.2.0
Thank you for this great plugin.
I want to override custom properties used in a third-party library. I tried to do that with
importFrom
. But I was surprised to see that the variables were not overridden.Inside this library, one of the components contains the following css rules:
I configure the following options:
I expect the border-radius to be 100px. But it remains 4px.
In source code I saw that variables from root have priority over variables from importFrom. Is this correct behavior?
In my opinion, the variables from importFrom should have the maximum priority.
I think those lines should be switched: https://github.com/postcss/postcss-custom-properties/blob/master/src/index.js#L31 https://github.com/postcss/postcss-custom-properties/blob/master/src/index.js#L32