From 580ca144fdc9a1adb0ae78459fe621d3634e236f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 5 Oct 2022 08:50:39 +0200 Subject: [PATCH] StyleGuide: Minor fix for themes.md (#56012) * Update themes.md * Update themes.md * Updates --- contribute/style-guides/themes.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contribute/style-guides/themes.md b/contribute/style-guides/themes.md index edf6e8eeb34..f6a0eea866b 100644 --- a/contribute/style-guides/themes.md +++ b/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 = () => { - 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