I know that my answer is going to be a little dirty.
But you know JSS has the ability similar to CSS.
If the CSS property you're looking for is named grid-template-columns
, then you can simply use gridTemplateColumns
.
Let's just do an example.
.container {
display: grid;
grid-template-columns: '100px 100px 100px';
}
In JSX, you can do something like..
const Grid = (props) => {
const style = {
display: 'grid',
gridTemplateColumns: [1,2,3].map(i => '100px').join(' ')
}
return <div style={style}></div>
}
Now above is a dirty code sample. If you want to neat it a little bit, it could be better of course! Like putting it in a useState
and changing it just when it needed to be.
But the point is simple. If you want to use a CSS property, you can just replace the CSS property name with a camelCase name convention and you will be fine.
Check out styling in React's documentation to learn more. React DOM Element Style