cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.08k stars 399 forks source link

Dynamic values don't work together with the extend plugin [React] #1471

Closed ilyador closed 3 years ago

ilyador commented 3 years ago

In the following code, the extending classes do not receive width but receive other styles from agenda:

agenda: {
  width: ({ baseSize }) => baseSize * 0.3,
  position: 'absolute',
  top: 4
},
firstAgenda: {
  extend: 'agenda',
  left: 2
},
secondAgenda: {
  extend: 'agenda',
  left: 52
}

If I copy it manually into each, it works:

agenda: {
  position: 'absolute',
  top: 4
},
firstAgenda: {
  width: ({ baseSize }) => baseSize * 0.3,
  extend: 'agenda',
  left: 2
}

Working example: https://codesandbox.io/s/objective-bassi-qn04t?file=/src/App.js

react-dom: 17.0.1 react-jss: 10.6.0

kof commented 3 years ago

Wait, you are in the wrong repo, styled-jss is not react-jss

kof commented 3 years ago

we already have this issue reported #1134