Objective
This recipe demonstrates a simple technique for styling widgets.
Procedure
- Create a
styles/HelloWorld.m.css
CSS file and add a style rule:
.root {
color: blue;
}
- Import your CSS:
import * as css from './styles/HelloWorld.m.css';
- Use the
classes
property to apply a CSS class to a virtual DOM node:
return v('div', { classes: css.root }, [ 'Hello' ]);
Additional resources
The Dojo Theming tutorial covers more advanced techniques of styling widgets