3 ms·
> it's the only way to structure UI for an application No, it's not. Want consistency in all your text boxes/links/buttons? Are you going to copy/paste or inhe
by purple_ducks 8y ago
> it's the only way to structure UI for an application
No, it's not. Want consistency in all your text boxes/links/buttons? Are you going to copy/paste or inherit from a base button component or define the general common styles in one place and have the browser automatically apply them with 0 thought.
Need a button to be different - then do inline styles or more specific selector(incl. CSS in JS) or use !important.
As parent poster said, definitively stating there is only one true™ way to do something is the height of hubris.
> That's why it's been so frustrating for me waiting to see this paradigm come to web development
Inline styles were the norm for quite a long period of time...
- mosdl 8y agoIn fact inline styles came first!
- tracker1 8y agoHere's roughly how I do it[1] ... import Button from '@material-ui/core/Button'; export MyComponent = ({actions}) => ( <Button variant="outlined" color="primary" onClick={actions.save} > Save </Button> ); [1] https://material-ui.com/demos/buttons/ https://material-ui.com/demos/buttons/