Comments (8)
@echoulen thank you, it works this great! May I suggest rewordingMake sure every theme with name property
to maybe Include a name attribute in the theme object
?
Anyways, I understand now. Thank you.
from storybook-addon-styled-component-theme.
make sure your storybook is v5
and
please install the latest version v1.2.3
from storybook-addon-styled-component-theme.
Thank you for the response.
Here is the list of dependencies from my package.json.
"@babel/cli": "^7.4.3",
"@babel/core": "^7.4.3",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/preset-env": "^7.4.3",
"@babel/preset-react": "^7.0.0",
"@storybook/addon-actions": "^5.0.11",
"@storybook/addon-info": "^5.0.11",
"@storybook/addon-links": "^5.0.11",
"@storybook/addon-options": "^5.0.11",
"@storybook/addon-storysource": "^5.0.11",
"@storybook/react": "^5.0.11",
"babel-loader": "^8.0.5",
"babel-plugin-styled-components": "^1.10.0",
"cross-env": "^5.2.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-html": "^5.0.5",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.13.0",
"lint-staged": "^8.1.6",
"npm": "^6.9.0",
"prettier": "^1.17.1",
"prop-types": "^15.7.2",
"react": "^16.8.2",
"react-dom": "^16.8.2",
"react-scripts": "^3.0.1",
"react-test-renderer": "^16.8.6",
"rollup": "^1.12.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-node-resolve": "^5.0.0",
"rollup-plugin-replace": "^2.1.1",
"storybook-addon-styled-component-theme": "^1.2.3",
"styled-components": "^4.1.3"
Here is the list of peer dependencies.
"react": "^16.8.6",
"react-dom": "^16.8.6",
"styled-components": "^2.0.0 || ^3.0.2"
Still experiencing the same issue. In the array of themes, only the first item of the list will be rendered onto the storybook, but I can investigate a bit further.
from storybook-addon-styled-component-theme.
@laujonat
may you show the themes object?
from storybook-addon-styled-component-theme.
Here's my theme.js.
const themes = {}
themes.default = {
text: "#333333",
success: "#0F9960",
alert: "C23030",
warn: "#F2B824",
}
themes.stealth = {
text: "#C23030",
success: "#C23030",
alert: "#C23030",
warn: "#C23030",
}
export default themes
And config.js
import { configure, addDecorator } from "@storybook/react"
import { withInfo } from "@storybook/addon-info"
import { withThemesProvider } from "storybook-addon-styled-component-theme"
import themes from "../src/shared/themes"
import GlobalStyle from "./decorators/globalStyle"
const _themes = [themes.default, themes.stealth]
addDecorator(GlobalStyle)
addDecorator(withThemesProvider(_themes)
Thank you
from storybook-addon-styled-component-theme.
https://github.com/echoulen/storybook-addon-styled-component-theme#remind
from storybook-addon-styled-component-theme.
@echoulen I'm sorry, unclear what you are referring to. The project is set up according to the specifications.
Here is the repository: https://github.com/laujonat/styled-lite
from storybook-addon-styled-component-theme.
modify your themes to
themes.default = {
name: "default",
text: "#333333",
success: "#0F9960",
alert: "C23030",
warn: "#F2B824",
}
themes.stealth = {
name: "stealth",
text: "#C23030",
success: "#C23030",
alert: "#C23030",
warn: "#C23030",
}
The name property of theme object is required
from storybook-addon-styled-component-theme.
Related Issues (20)
- Does not look good for storybook 5.1.9 HOT 2
- RowStyle not getting applied HOT 4
- Possible to pass own wrapper? HOT 5
- Open story in new tab button doesn't work HOT 11
- Is it possible to customize themes selector buttons style?
- Panel Layout Broken for Themes With A Name of More Than One Word
- Storybook 5.x canvas view broken HOT 11
- Providing a single theme means story is not rendered HOT 1
- With Theme.js
- Change iframe background with theme selection HOT 2
- CustomProvider not working as expected HOT 3
- Remember selected theme across stories HOT 1
- Support for storybook ^6.1.0 version HOT 3
- vulnerability CVE-2020-15168 is introduced by package node-fetch HOT 1
- How to export component with theme?
- refactor to hooks
- Inconsistency in import style
- Support for Storybook v6.5 HOT 1
- Light and Dark theme switcher is not working. HOT 1
- Support for Storybook v7 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook-addon-styled-component-theme.