Skip to content

Commit 65f8a16

Browse files
authored
Merge pull request #126 from clue-labs/tailwind
Add minimal build of Tailwind CSS v3.2.4 instead of using full CSS
2 parents a41e37c + ab83b55 commit 65f8a16

7 files changed

Lines changed: 27 additions & 5 deletions

File tree

.github/workflows/diff.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
with:
2121
php-version: ${{ matrix.php }}
2222
coverage: none
23-
- run: test -f Makefile || echo -en "build:\n\tcomposer install\n\tvendor/bin/sculpin generate\n" > Makefile # remove me once Makefile is merged
2423
- run: make && mv build/ old/
2524

2625
# check out head ref and build site into new/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor/
22
/build/
3+
/tailwindcss

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
build: vendor
1+
build: vendor www/src/tailwind.min.css
22
vendor/bin/sculpin generate
33

44
vendor: composer.json composer.lock
55
composer install
66
touch $@
77

8+
www/src/tailwind.min.css: www/_layouts/* www/_posts/* www/_talks/* www/*.html www/*.html.twig tailwindcss tailwind.config.js
9+
./tailwindcss -o $@ --minify
10+
touch $@
11+
12+
tailwindcss:
13+
test -x tailwindcss || curl -L https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-linux-x64 > tailwindcss && chmod +x tailwindcss
14+
815
serve: build
916
docker run -it --rm -p 80:80 -v "$$PWD"/build/:/var/www/html/ php:8.1-apache sh -c "ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground"
1017

@@ -15,8 +22,9 @@ served: build
1522

1623
test:
1724
bash tests/acceptance.sh
25+
test -z "$$(git status --porcelain)" || (echo Directory is dirty && git status && exit 1)
1826

1927
clean:
20-
rm -rf build/ vendor/
28+
rm -rf build/ vendor/ tailwindcss
2129

2230
.PHONY: build serve served test clean

tailwind.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: [
4+
"www/_layouts/*",
5+
"www/_posts/*",
6+
"www/_talks/*",
7+
"www/*.html",
8+
"www/*.html.twig"
9+
],
10+
theme: {
11+
extend: {},
12+
},
13+
plugins: [],
14+
}

www/_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>{{ page.title }}</title>
88
<link href="{{base}}src/landing-page.v2.css" rel="stylesheet">
9-
<link href="{{base}}src/tailwind-2.0.3.min.css" rel="stylesheet">
9+
<link href="{{base}}src/tailwind.min.css" rel="stylesheet">
1010
{# always include javascript except for index and blog posts #}
1111
{% if page.url != "/." and not (page.url matches "#/.*/#") %}
1212
<script async src="{{base}}src/app.v2.js"></script>

www/src/tailwind-2.0.3.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

www/src/tailwind.min.css

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

0 commit comments

Comments
 (0)