-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Tailwind for TodoMVC example (#75)
* configure tailwind for todomvc example * partially style todomvc with tailwind * comment about tailwind script
- Loading branch information
1 parent
c90431e
commit e2cace8
Showing
7 changed files
with
205 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer base { | ||
:root { | ||
--color-text: 26 26 26; | ||
--color-background: 245 245 245; | ||
|
||
--color-accent: 175 47 47; | ||
|
||
--color-neutral-50: 250 250 250; | ||
--color-neutral-100: 242 242 242; | ||
--color-neutral-200: 230 230 230; | ||
--color-neutral-300: 193 193 193; | ||
--color-neutral-400: 153 153 153; | ||
--color-neutral-500: 119 119 119; | ||
--color-neutral-600: 85 85 85; | ||
--color-neutral-700: 68 68 68; | ||
--color-neutral-800: 51 51 51; | ||
--color-neutral-900: 34 34 34; | ||
} | ||
|
||
.dark { | ||
--color-text: 255 255 255; | ||
--color-background: 0 0 0; | ||
|
||
--color-accent: 175 47 47; | ||
|
||
--color-neutral-50: 34 34 34; | ||
--color-neutral-100: 51 51 51; | ||
--color-neutral-200: 68 68 68; | ||
--color-neutral-300: 85 85 85; | ||
--color-neutral-400: 119 119 119; | ||
--color-neutral-500: 153 153 153; | ||
--color-neutral-600: 193 193 193; | ||
--color-neutral-700: 230 230 230; | ||
--color-neutral-800: 242 242 242; | ||
--color-neutral-900: 250 250 250; | ||
} | ||
} | ||
|
||
@font-face { | ||
font-family: Inter; | ||
src: url(/fonts/Inter/Inter-Medium.ttf) format("ttf"); | ||
font-style: normal; | ||
font-weight: 500; | ||
font-display: swap; | ||
} | ||
|
||
@font-face { | ||
font-family: Inter; | ||
src: url(/fonts/Inter/Inter-SemiBold.ttf) format("ttf"); | ||
font-style: "Semi Bold"; | ||
font-weight: 400; | ||
font-display: swap; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const colors = require("tailwindcss/colors"); | ||
const defaultTheme = require('tailwindcss/defaultTheme') | ||
|
||
module.exports = { | ||
darkMode: "class", | ||
content: [ | ||
"./examples/todomvc/**/*.rs" | ||
], | ||
theme: { | ||
colors: { | ||
inherit: colors.inherit, | ||
current: colors.current, | ||
transparent: colors.transparent, | ||
|
||
text: getColor("text"), | ||
background: getColor("background"), | ||
|
||
accent: getColorVariant("accent", ["DEFAULT"]), | ||
neutral: getColorVariant("neutral", [50, 100, 200, 300, 400, 500, 600, 700, 800, 900]), | ||
}, | ||
fontFamily: { | ||
sans: ["Inter", ...defaultTheme.fontFamily.sans], | ||
mono: defaultTheme.fontFamily.mono, | ||
}, | ||
screens: { | ||
md: "768px", | ||
lg: "1024px", | ||
xl: "1280px" | ||
}, | ||
extend: { | ||
maxWidth: theme => ({ | ||
"screen-xl": theme("screens.xl"), | ||
}) | ||
} | ||
}, | ||
plugins: [ | ||
require('@tailwindcss/typography'), | ||
], | ||
}; | ||
|
||
function getColor(name) { | ||
return `rgb(var(--color-${name}) / <alpha-value>)` | ||
} | ||
|
||
function getColorVariant(name, keys) { | ||
return keys.reduce((prev, key) => ({ | ||
...prev, | ||
[key]: getColor(key === "DEFAULT" ? name : `${name}-${key}`), | ||
}), {}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e2cace8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
bevy-dioxus – ./
bevy-dioxus-junichi.vercel.app
www.bevydioxus.com
bevydioxus.com
bevy-dioxus-git-main-junichi.vercel.app
bevy-dioxus.com