StyleGuide: Minor fix for themes.md (#56012)

* Update themes.md

* Update themes.md

* Updates
pull/55458/head
Torkel Ödegaard 3 years ago committed by GitHub
parent 3f4bf76324
commit 580ca144fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      contribute/style-guides/themes.md

@ -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…
Cancel
Save