• Stars
    star
    267
  • Rank 148,636 (Top 4 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Using Tailwind CSS for Themeable Interfaces

Screenshot

This is really basic demo showing how you might approach configuring Tailwind CSS if you needed an interface to support multiple themes.

The basic premise is to define your styles in your config file using CSS Custom Properties, and use a more functional/"semantic" naming scheme for your classes.

For example, here's how the text colors are defined in this demo:

textColor: {
    primary: "var(--color-text-primary)",
    secondary: "var(--color-text-secondary)",
    default: "var(--color-text-default)",
    "default-soft": "var(--color-text-default-soft)",
    inverse: "var(--color-text-inverse)",
    "inverse-soft": "var(--color-text-inverse-soft)"
},

Each theme then defines these custom properties inside of their own theme class:

.theme-startup {
  --color-text-primary: #fff;
  --color-text-secondary: #44467b;
  --color-text-default: #373737;
  --color-text-default-soft: #6a6a6a;
  --color-text-inverse: #fff;
  --color-text-inverse-soft: rgba(255, 255, 255, 0.7);
}

.theme-boring {
  --color-text-primary: #fff;
  --color-text-secondary: #755f17;
  --color-text-default: #444;
  --color-text-default-soft: #999;
  --color-text-inverse: #444;
  --color-text-inverse-soft: #999;
}

.theme-elegant {
  --color-text-primary: #fff;
  --color-text-secondary: #927e7e;
  --color-text-default: #373737;
  --color-text-default-soft: #6a6a6a;
  --color-text-inverse: #fff;
  --color-text-inverse-soft: #bbb;
}

More Repositories

1

laracon2017

PHP
469
star
2

workcation

Vue
425
star
3

bootforms

Rapid form generation with Bootstrap 3 and Laravel.
PHP
419
star
4

vue-tailwind-examples

Vue
390
star
5

eloquent-oauth

Braindead simple social login with Laravel and Eloquent.
PHP
374
star
6

laravel-preset

PHP
277
star
7

sublime-phpunit

Run individual unit test files directly from Sublime
Python
276
star
8

form

Super basic form HTML builder, only really exists so I can pull it in for some other more useful projects.
PHP
232
star
9

eloquent-oauth-l5

Eloquent OAuth service provider and assets for Laravel 5
PHP
214
star
10

tailwind-take-home-project

Vue
132
star
11

vue-shopify-sortable-demo

HTML
113
star
12

fullstackradio.com

JavaScript
90
star
13

test-driven-laravel-from-scratch

PHP
81
star
14

tailwind-css-variable-text-opacity-demo

JavaScript
77
star
15

entypo-optimized

61
star
16

tailwindcss-dark-mode-prototype

JavaScript
58
star
17

workcation-theme-ui

JavaScript
38
star
18

vueconfto-demo

Vue
38
star
19

rebuilding-netlify

JavaScript
32
star
20

sublime-themes

Personal mods for ST themes I use
31
star
21

tailwind-animation-playground

HTML
27
star
22

laracon-madrid

The source code for my "Advanced Vue Component Design" at Laracon EU Madrid.
Vue
27
star
23

cra-tailwind-3

HTML
27
star
24

tailwind-jit-vite-example

Vue
25
star
25

tailwind-starter

CSS
24
star
26

rebuilding-allbirds-with-tailwindcss

JavaScript
24
star
27

laracon-2020

Vue
24
star
28

faktory

An attempt to bring the wonders of FactoryGirl to PHP.
PHP
22
star
29

rebuilding-transistor

JavaScript
22
star
30

tailwindcss-jit-next

JavaScript
17
star
31

tailwind-ui-navbar-react

JavaScript
16
star
32

nuxt-storybook

Vue
16
star
33

workcation-splash-page

HTML
15
star
34

vue-sidebar-layout

Vue
15
star
35

next10-tailwind

JavaScript
14
star
36

cra-tailwind-demo

JavaScript
12
star
37

next-nested-routing

JavaScript
12
star
38

laracon-online-2019

PHP
10
star
39

jit-vite-preact

TypeScript
9
star
40

nuxt-nested-layouts

Vue
9
star
41

tweeter-eu

PHP
8
star
42

tailwind-jit-cra-example

JavaScript
7
star
43

tailwind-cra-next

JavaScript
7
star
44

jit-postcss-demo

HTML
7
star
45

vue-rename-tailwind-config

JavaScript
7
star
46

activerest

ActiveRecord wrapper for REST APIs
PHP
7
star
47

postcss8-tailwind

JavaScript
6
star
48

dotfiles

JavaScript
6
star
49

headbangstagram

JavaScript
6
star
50

solid-tailwind-setup-example

JavaScript
5
star
51

tailwind-browserslist-test

HTML
5
star
52

tailwind-color-name-test

JavaScript
5
star
53

facktory

An attempt to bring the wonders of FactoryGirl to PHP
PHP
5
star
54

phxtailwindui

Elixir
4
star
55

tw3-cra-typescript-example

HTML
4
star
56

tw-devtools-perf

Vue
4
star
57

tailwind-color-function-demo

JavaScript
4
star
58

socialnorm

PHP
4
star
59

eloquent-oauth-l4

Eloquent OAuth service provider and assets for Laravel 4
PHP
4
star
60

tailwind-2-aspect-ratio

CSS
4
star
61

upgrade-config

JavaScript
4
star
62

next-cssnano-issue

CSS
3
star
63

sveltekit-forms-esm-demo

Svelte
3
star
64

at-apply-stuck

JavaScript
3
star
65

game-of-life

HTML
3
star
66

tailwind-plugin-color-extend-example

JavaScript
3
star
67

vite-issue-repro

Vue
3
star
68

micheltazartes

JavaScript
3
star
69

lets-refactor-zendcon

PHP
3
star
70

tailwindcss-i2369

JavaScript
2
star
71

tailwind-repro-8597

HTML
2
star
72

base-comment-delete-test

CSS
2
star
73

focus-visible-test

CSS
2
star
74

socialnorm-google

Google provider for SocialNorm
PHP
2
star
75

issue-10419

JavaScript
2
star
76

eloquent-oauth-example

Basic example Laravel app with minimal setup required for Eloquent OAuth
PHP
2
star
77

tailwind-repro-8661

CSS
2
star
78

thready-site

HTML
1
star
79

next-color-import-test

JavaScript
1
star
80

next-tailwind-hot-reload-issue

JavaScript
1
star
81

tw-postcss7-purge-test

CSS
1
star
82

tailwind-issue-7685

HTML
1
star
83

simple-design-ssphp16

PHP
1
star
84

vite-vue2-jit-issue

HTML
1
star
85

gulp-postcss-dependency-bug

JavaScript
1
star
86

vagrant-php

Just a little provisioning script and Vagrantfile, I'm sure I'll refine it over time.
Shell
1
star
87

parcel-2-postcss-dependency-bug

JavaScript
1
star
88

tailwindcss-forms-class-strategy-test

CSS
1
star
89

tw-postcss8-issue

JavaScript
1
star
90

eloquent-oauth-l5-example

PHP
1
star
91

vue-tailwind-library

Vue
1
star
92

larawedding

PHP
1
star
93

socialnorm-linkedin

LinkedIn provider for SocialNorm
PHP
1
star
94

metamarkdown

PHP
1
star
95

postcss-normalize-bug

CSS
1
star
96

postcss-use-bug

JavaScript
1
star
97

vite-jsx-build-fail

Vue
1
star
98

turbopack-test

CSS
1
star