Comparing version 0.0.30 to 0.1.0
# Smelte changelog | ||
# 0.1.0 | ||
* Start API docs | ||
* Expose tailwind config | ||
* Add colors to chips | ||
* More consistent API | ||
* New props for data tables | ||
* Split docs components (props table and code) | ||
# 0.0.29 | ||
@@ -4,0 +12,0 @@ * Better transparent variants |
{ | ||
"name": "smelte", | ||
"description": "UI framework for Svelte using Tailwind CSS", | ||
"version": "0.0.30", | ||
"version": "0.1.0", | ||
"scripts": { | ||
@@ -26,2 +26,4 @@ "dev": "sapper dev -p 7777", | ||
"src/utils", | ||
"src/tailwind.css", | ||
"src/index.js", | ||
"src/stores.js", | ||
@@ -28,0 +30,0 @@ "src/components", |
@@ -0,7 +1,16 @@ | ||
const noDepth = ["white", "black", "transparent"]; | ||
function getClass(prop, color, depth, defaultDepth) { | ||
if (noDepth.includes(color)) { | ||
return `${prop}-${color}`; | ||
} | ||
return `${prop}-${color}-${depth || defaultDepth} `; | ||
} | ||
export default function utils(color, defaultDepth = 500) { | ||
return { | ||
bg: depth => `bg-${color}-${depth || defaultDepth} `, | ||
border: depth => `border-${color}-${depth || defaultDepth} `, | ||
txt: depth => `text-${color}-${depth || defaultDepth} `, | ||
caret: depth => `caret-${color}-${depth || defaultDepth} ` | ||
bg: depth => getClass("bg", color, depth, defaultDepth), | ||
border: depth => getClass("border", color, depth, defaultDepth), | ||
txt: depth => getClass("text", color, depth, defaultDepth), | ||
caret: depth => getClass("caret", color, depth, defaultDepth) | ||
}; | ||
@@ -8,0 +17,0 @@ } |
@@ -23,10 +23,8 @@ // Color generation utility borrowed from | ||
const lightest = o(tinycolor.mix(white, hex, 12), "50"); | ||
const lightest = o(tinycolor.mix(white, hex, 30), "100"); | ||
return { | ||
...lightest, | ||
transLight: tinycolor(lightest[50]) | ||
transLight: tinycolor(lightest[100]) | ||
.toRgbString() | ||
.replace(")", ", 0.6)"), | ||
trans: tinycolor(lightest[50]) | ||
trans: tinycolor(lightest[100]) | ||
.toRgbString() | ||
@@ -37,3 +35,5 @@ .replace(")", ", 0.7)"), | ||
.replace(")", ", 0.15)"), | ||
...o(tinycolor.mix(white, hex, 30), "100"), | ||
...o(tinycolor.mix(white, hex, 12), "50"), | ||
...lightest, | ||
...o(tinycolor.mix(white, hex, 50), "200"), | ||
@@ -40,0 +40,0 @@ ...o(tinycolor.mix(white, hex, 70), "300"), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
727574
91
2272