1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-22 19:44:21 +00:00

🐛 Fix Color breaking outside the styleguide

This commit is contained in:
Steffo 2021-03-23 17:37:07 +01:00
parent 759d9c1479
commit a85421b2f8
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "bluelib", "name": "bluelib",
"version": "2.1.0", "version": "2.1.1",
"description": "React components for Bluelib", "description": "React components for Bluelib",
"readme": "README.md", "readme": "README.md",
"main": "lib/index.js", "main": "lib/index.js",

View file

@ -6,6 +6,8 @@ import color from "color"
export default function Color({children, builtin, custom}) { export default function Color({children, builtin, custom}) {
const potentialClassName = useBluelibClassNames(`color-${builtin}`)
if(builtin && custom) { if(builtin && custom) {
throw new Error("<Color> tags may only have one prop between `builtin` and `custom`.") throw new Error("<Color> tags may only have one prop between `builtin` and `custom`.")
} }
@ -14,7 +16,7 @@ export default function Color({children, builtin, custom}) {
let extraStyle = {}; let extraStyle = {};
if(builtin !== undefined) { if(builtin !== undefined) {
extraClassName = useBluelibClassNames(`color-${builtin}`) extraClassName = potentialClassName
} }
if(custom !== undefined) { if(custom !== undefined) {