mirror of
https://github.com/Steffo99/bluelib.git
synced 2024-12-23 03:54:21 +00:00
🐛 Fix Color breaking outside the styleguide
This commit is contained in:
parent
759d9c1479
commit
a85421b2f8
2 changed files with 4 additions and 2 deletions
|
@ -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",
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue