mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
StyleGuide: Minor fix for themes.md (#56012)
* Update themes.md * Update themes.md * Updates
This commit is contained in:
parent
3f4bf76324
commit
580ca144fd
@ -25,16 +25,16 @@ import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import { css } from '@emotion/css';
|
||||
|
||||
const getComponentStyles = (theme: GrafanaTheme2) => css`
|
||||
padding: ${theme.spacing.md};
|
||||
`;
|
||||
|
||||
const Foo: FC<FooProps> = () => {
|
||||
const styles = useStyles2(getComponentsStyles);
|
||||
function Foo(props: FooProps) {
|
||||
const styles = useStyles2(getStyles);
|
||||
// Use styles with className
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
const getStyles = (theme: GrafanaTheme2) => css({
|
||||
padding: theme.spacing(1,2)
|
||||
});
|
||||
|
||||
#### Get the theme object
|
||||
|
||||
```tsx
|
||||
|
Loading…
Reference in New Issue
Block a user