I am currently building a tab component and build inline variables for the CSS styling. This is for a streamlit app which allows me to make adjustments on the python end. Currently, I have about four elements that have CSS styling so I have four different style variables like the below:
const navStyle: React.CSSProperties = this.props.args['navStyle'] || {}
const tabStyle: React.CSSProperties = this.props.args['tabStyle'] || {}
const tabOptionsStyle = this.props.args['tabOptionsStyle'] || {}
const iconStyle: React.CSSProperties = this.props.args['iconStyle'] || {}
So instead of this (demonstrated in Typescript/React):
const navStyle: React.CSSProperties = {
backgroundColor:'#111',
}
const tabStyle: React.CSSProperties = {
marginBottom:'30px'
}
const tabOptionsStyle = style({
":hover": {color: '#f1f1f1',
cursor: 'pointer'}
})
const iconStyle: React.CSSProperties = {
position:'fixed'
}
What I want is something like this (demonstrated in Typescript/React):
const style = {
navStyle {
}
tabStyle {
}
tabOptionsStyle {
}
iconStyle {
}
}
How would I create variables that produce the latter instead of the former?
Note
- tabOptionsStyle is styled using {style} from glamor.