|
| 1 | +import { Meta, Source } from "@storybook/blocks" |
| 2 | + |
| 3 | +<Meta title="Styling" /> |
| 4 | + |
| 5 | +# Styling |
| 6 | + |
| 7 | +This component uses Tailwind and shadcn/ui for styling and structuring the component. You can customize many aspects of |
| 8 | +the theme, like colors and edge radius. You can also switch between dark and light mode by using the `dark` prop on |
| 9 | +`<ReactSearchComponent dark={currentTheme === "dark"} />` |
| 10 | + |
| 11 | +## CSS Variables |
| 12 | + |
| 13 | +The following CSS variables can be overwritten to match your needs. Shown are the default values. Make sure to also |
| 14 | +**supply your color values in HSL**. |
| 15 | + |
| 16 | +> **Note:** Some variables might currently not be in use |
| 17 | +
|
| 18 | +<Source code={` |
| 19 | +--rfs-background: 0 0% 100%; |
| 20 | +--rfs-foreground: 0 0% 3.9%; |
| 21 | +--rfs-card: 0 0% 100%; |
| 22 | +--rfs-card-foreground: 0 0% 3.9%; |
| 23 | +--rfs-popover: 0 0% 100%; |
| 24 | +--rfs-popover-foreground: 0 0% 3.9%; |
| 25 | +--rfs-primary: 215 100% 50%; |
| 26 | +--rfs-primary-foreground: 0 0% 98%; |
| 27 | +--rfs-secondary: 0 0% 96.1%; |
| 28 | +--rfs-secondary-foreground: 0 0% 9%; |
| 29 | +--rfs-muted: 0 0% 96.1%; |
| 30 | +--rfs-muted-foreground: 0 0% 45.1%; |
| 31 | +--rfs-accent: 0 0% 96.1%; |
| 32 | +--rfs-accent-foreground: 0 0% 9%; |
| 33 | +--rfs-destructive: 0 84.2% 60.2%; |
| 34 | +--rfs-destructive-foreground: 0 0% 98%; |
| 35 | +--rfs-border: 0 0% 89.8%; |
| 36 | +--rfs-input: 0 0% 89.8%; |
| 37 | +--rfs-ring: 0 0% 3.9%; |
| 38 | +--rfs-chart-1: 12 76% 61%; |
| 39 | +--rfs-chart-2: 173 58% 39%; |
| 40 | +--rfs-chart-3: 197 37% 24%; |
| 41 | +--rfs-chart-4: 43 74% 66%; |
| 42 | +--rfs-chart-5: 27 87% 67%; |
| 43 | +
|
| 44 | +--rfs-radius: 0.5rem; |
| 45 | +
|
| 46 | +/* Only required if you want to use dark mode */ |
| 47 | +/* You only have to specify variables you want to change (compared to light mode) */ |
| 48 | +.dark { |
| 49 | + --rfs-background: 0 0% 3.9%; |
| 50 | + --rfs-foreground: 0 0% 98%; |
| 51 | + --rfs-card: 0 0% 3.9%; |
| 52 | + --rfs-card-foreground: 0 0% 98%; |
| 53 | + --rfs-popover: 0 0% 3.9%; |
| 54 | + --rfs-popover-foreground: 0 0% 98%; |
| 55 | + --rfs-primary: 215 100% 40%; |
| 56 | + --rfs-primary-foreground: 0 0% 98%; |
| 57 | + --rfs-secondary: 0 0% 14.9%; |
| 58 | + --rfs-secondary-foreground: 0 0% 98%; |
| 59 | + --rfs-muted: 0 0% 14.9%; |
| 60 | + --rfs-muted-foreground: 0 0% 63.9%; |
| 61 | + --rfs-accent: 0 0% 14.9%; |
| 62 | + --rfs-accent-foreground: 0 0% 98%; |
| 63 | + --rfs-destructive: 0 62.8% 30.6%; |
| 64 | + --rfs-destructive-foreground: 0 0% 98%; |
| 65 | + --rfs-border: 0 0% 14.9%; |
| 66 | + --rfs-input: 0 0% 14.9%; |
| 67 | + --rfs-ring: 0 0% 83.1%; |
| 68 | + --rfs-chart-1: 220 70% 50%; |
| 69 | + --rfs-chart-2: 160 60% 45%; |
| 70 | + --rfs-chart-3: 30 80% 55%; |
| 71 | + --rfs-chart-4: 280 65% 60%; |
| 72 | + --rfs-chart-5: 340 75% 55%; |
| 73 | +} |
| 74 | +`} /> |
| 75 | + |
| 76 | +## CSS classes |
| 77 | + |
| 78 | +CSS classes with prefix `sui-` are specified in the `elastic-ui.css` file, these classes can be directly overwritten in your CSS. |
| 79 | + |
| 80 | +Tailwind classes start with `rfs-`. Colors should be overwritten by using the color variables above. |
0 commit comments