Support JSS extend plugin by default
See original GitHub issueExpected Behavior
- Text color:
#FF0000
.App-text-273 {
color: #FF0000; // <--- Expected
cursor: pointer;
font-size: 50px;
user-select: none;
}
Current Behavior
.App-text-273 {
extend: ext; // <--- Invalid
cursor: pointer;
font-size: 50px;
user-select: none;
}
Steps to Reproduce (for bugs)
import React, { Component } from 'react'
import ReactDOM, { render } from 'react-dom'
import PropTypes from 'prop-types'
import { withStyles } from 'material-ui/styles'
const styles = theme => ({
ext: {
color: '#FF0000',
},
text: {
extend: 'ext',
fontSize: '50px',
cursor: 'pointer',
userSelect: 'none'
}
})
@withStyles(styles)
class App extends Component {
static propTypes = {
classes: PropTypes.object.isRequired
}
onClick(event) {
const className = event.target.getAttribute('class')
const style = getComputedStyle(event.target, null)
const { fontSize, cursor, userSelect, color } = style
console.log(`className: ${className}`)
console.log({ fontSize, cursor, userSelect, color })
}
render() {
const { classes } = this.props
return (
<p className={classes.text} onClick={this.onClick}>Foo Bar Baz</p>
)
}
}
render(<App />, document.getElementById('root'))
Environment
Tech | Version |
---|---|
Material-UI | 1.0.0-beta.22 |
React | 16.0.0 |
browser | Chrome Version 62.0.3202.94 (Official Build) (64-bit) |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:27
- Comments:60 (27 by maintainers)
Top Results From Across the Web
Support JSS extend plugin by default #9342 - mui/material-ui
@vdimitroff Material-UI allows providing custom JSS plugins. The issue was about changing the default ones. 1
Read more >jss-plugin-default-unit
Default units for numeric values. Provide numeric values in your style definitions, and the plugin will insert the corresponding units.
Read more >jss-plugin-extend | Yarn - Package Manager
[jss] Keyframe IDs are now scoped by default. [jss] Function values, function rules and observables apply plugins by default now, which means they...
Read more >Advanced styling in material-ui - Stack Overflow
jss -plugin-extend is not included by default in Material-UI. You can find the list of included JSS plugins here: ...
Read more >jss-plugin-extend - npm
JSS plugin that enables mixing in styles.. Latest version: 10.9.2, last published: 5 months ago. Start using jss-plugin-extend in your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tdkn Thanks for the feedback. I’m adding the change into the breaking change part of the changelog.
👍 on re-adding back those two (extend and compose). They’re definitely worth it for a mere 2KB IMO.