Giter Site home page Giter Site logo

h-des / storybook-addon-ondevice-styled-theme Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 4.0 39 KB

Home Page: https://www.npmjs.com/package/storybook-addon-ondevice-styled-theme

License: MIT License

JavaScript 100.00%
storybook-addon storybook styled-components styled-components-theme react-native

storybook-addon-ondevice-styled-theme's People

storybook-addon-ondevice-styled-theme's Issues

Theme is not updating

I am trying to use this addon with my styled components but theme is not updating on switching themes.

.story
import { storiesOf } from '@storybook/react-native'; storiesOf('Theming', module) .addDecorator(withTheme) .addParameters({ themes: [ { name: 'Default Theme', ...DefaultTheme }, { name: 'Secondary Theme', ...SecondaryTheme, }, ], }) .add('Themes', ThemeStories);
.rn-addons
import '@storybook/addon-ondevice-actions/register'; import '@storybook/addon-ondevice-knobs/register'; import 'storybook-addon-ondevice-styled-theme/register';
Preview:
git

Themes :

`export const theme = {
space: [1, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 56, 64, 80, 96, 112, 128],
fontSizes: [10, 12, 14, 16, 20, 24, 32, 36],
fontWeights: [200, 400, 600],
lineHeights: [16, 19, 22, 24, 32],
borders: ['0px', '1px solid', '2px solid', '4px solid'],
radii: [0, 4, 8, 12, 16, 30, 50, 100],
sizes: [1, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 56, 64, 80, 96, 112, 128],
colors: {
'info': {
light: '#D6F1FC',
medium: '#3182CE',
dark: '#092562',
},
'warning': {
light: '#FDEDD1',
medium: '#DD6B20',
dark: '#9F3710',
},
'success': {
light: '#D9FADB',
medium: '#38A169',
dark: '#0A4D44',
},
'danger': {
light: '#FDE5D8',
medium: '#E53E3E',
dark: '#6D0B2D',
},
'primary': '#5F2F37',
'secondary': '#370E20',
'highlight': '#F0E0DA',
'accent': '#EEC4BE',
'muted': '#E2E2E2',
'text-muted': '#828282',

'black': '#111111',
'white': '#ffffff',

},
};
export const secondaryTheme = {
space: [1, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 56, 64, 80, 96, 112, 128],
fontSizes: [10, 12, 14, 16, 20, 24, 32, 36],
fontWeights: [200, 400, 600],
lineHeights: [16, 19, 22, 24, 32],
borders: ['0px', '1px solid', '2px solid', '4px solid'],
radii: [0, 4, 8, 12, 16, 30, 50, 100],
sizes: [1, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 56, 64, 80, 96, 112, 128],
colors: {
'info': {
light: '#CCE6EC',
medium: '#00819E',
dark: '#005669',
},
'warning': {
light: '#FDEDD1',
medium: '#DD6B20',
dark: '#9F3710',
},
'success': {
light: '#D9FADB',
medium: '#38A169',
dark: '#2B450B',
},
'danger': {
light: '#F1CED5',
medium: '#BA0C2F',
dark: '#A41F36',
},
'primary': '#BA0C2F',
'secondary': '#FFB81C',
'highlight': '#F0E0DA',
'accent': '#EEC4BE',
'muted': '#E2E2E2',
'text-muted': '#828282',
'black': '#111111',
'white': '#ffffff',
},
};
`

cc : @h-des Many thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.