Skip to content

Commit 9124b53

Browse files
committed
fix: isUnit
1 parent 0919941 commit 9124b53

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

npm/CssToTailwindTranslator.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ const isColor = (str: string, joinLinearGradient = false) => {
187187
}
188188

189189
const isUnit = (str: string) => {
190+
if (str.length > 0) {
191+
return true
192+
}
190193
return [
191194
'em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax',
192195
'cm', 'mm', 'in', 'pt', 'pc', 'px', 'min-content', 'max-content', 'fit-content',
@@ -2100,7 +2103,9 @@ let moreDefaultValuesMap: Record<string, Record<string, string>> = {
21002103
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace': 'font-mono',
21012104
},
21022105
'font-weight': {
2103-
"100": "font-thin", "200": "font-extralight", "300": "font-light", "400": "font-normal", "500": "font-medium", "600": "font-semibold", "700": "font-bold", "800": "font-extrabold", "900": "font-black"
2106+
"100": "font-thin", "200": "font-extralight", "300": "font-light", "400": "font-normal", "500": "font-medium", "600": "font-semibold", "700": "font-bold", "800": "font-extrabold", "900": "font-black",
2107+
"normal": "font-normal",
2108+
"bold": "font-bold",
21042109
},
21052110
'line-height': {
21062111
"1": "leading-none", "2": "leading-loose", ".75rem": "leading-3", "1rem": "leading-4", "1.25rem": "leading-5", "1.5rem": "leading-6", "1.75rem": "leading-7", "2rem": "leading-8", "2.25rem": "leading-9", "2.5rem": "leading-10", "1.25": "leading-tight", "1.375": "leading-snug", "1.5": "leading-normal", "1.625": "leading-relaxed"

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "css-to-tailwind-translator",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "Convert CSS code to Tailwindcss syntax in real time",
55
"scripts": {},
66
"repository": {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "css-to-tailwind",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
@@ -15,7 +15,7 @@
1515
"@monaco-editor/react": "^4.4.6",
1616
"clipboard": "^2.0.11",
1717
"clsx": "^1.2.1",
18-
"css-to-tailwind-translator": "^1.2.5",
18+
"css-to-tailwind-translator": "^1.2.6",
1919
"next": "13.2.4",
2020
"react": "18.2.0",
2121
"react-dom": "18.2.0",

pages/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ export default function Home() {
184184
onChange={handleChange}
185185
value={''}
186186
onMount={handleEditorDidMount}
187+
loading={
188+
<div className="text-[#111827] dark:text-[#abb2bf] text-[37px]">Loading...</div>
189+
}
187190
options={{
188191
fontSize: 18
189192
}}

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)