Skip to content

Commit

Permalink
chore: upate preview
Browse files Browse the repository at this point in the history
  • Loading branch information
g-francesca committed Jul 11, 2024
1 parent f3b8208 commit c8696ff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
15 changes: 11 additions & 4 deletions apps/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ import 'ui-stencil/dist/orama-ui/orama-ui.css'

defineCustomElements()

const LIGTH_THEME_BG = '#fbfbfb'
const DARK_THEME_BG = '#050505'

/** @type { import('@storybook/html').Preview } */
const preview = {
// TODO: Theme class should be a variable
decorators: [(story) => `<div id="orama-ui" class="theme-ligth">${story()}</div>`],
decorators: [
(story, context) => {
const classTheme = context.globals.backgrounds.value === DARK_THEME_BG ? 'theme-dark' : 'theme-light'
return `<div id="orama-ui" class="${classTheme}" style="padding: 20px">${story()}</div>`
},
],
parameters: {
controls: {
matchers: {
Expand All @@ -19,11 +26,11 @@ const preview = {
values: [
{
name: 'dark',
value: '#050505',
value: DARK_THEME_BG,
},
{
name: 'light',
value: '#fbfbfb',
value: LIGTH_THEME_BG,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class OramaSearch {

render() {
return (
<Host style={{ background: 'black', color: 'white' }}>
<Host>
<div>
<orama-input
autofocus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
align-items: center;

border-radius: var(--radius-3xl, $radius-3xl);
background: var(---background-color-fourth, background-color('fourth'));
background: var(--background-color-fourth, background-color('fourth'));
overflow: hidden;

button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class SearchBox {
padding: '16px 0',
alginItems: 'center',
justifyContent: 'center',
backgroundColor: 'black',
color: 'white',
}}
>
Expand Down

0 comments on commit c8696ff

Please sign in to comment.