Build Tailwind CSS within the theme

This commit is contained in:
Oliver Davies 2024-04-04 18:00:00 +01:00
parent 061a951770
commit 37589139d5
11 changed files with 1550 additions and 2 deletions

View file

@ -0,0 +1 @@
use flake .

5
web/themes/custom/opdavies/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
/.direnv/
/dist/*
/node_modules/
!/dist/.keep

View file

@ -0,0 +1,39 @@
import colours from "tailwindcss/colors";
import formsPlugin from '@tailwindcss/forms';
import type { Config } from 'tailwindcss'
import typographyPlugin from "@tailwindcss/typography";
export default {
content: [
"./opdavies.theme",
"./templates/**/*.html.twig",
],
theme: {
colors: {
black: "#000",
blue: {
primary: "#24608A",
400: "#60a5fa",
},
current: "currentColor",
grey: colours.stone,
inherit: "inherit",
transparent: "transparent",
white: "#fff",
},
extend: {
fontFamily: {
sans: [
"Roboto Condensed",
"Arial",
"Helvetica Neue",
"Helvetica",
"sans-serif",
],
},
},
},
plugins: [formsPlugin, typographyPlugin],
} satisfies Config

File diff suppressed because one or more lines are too long

0
web/themes/custom/opdavies/dist/.keep vendored Normal file
View file

View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1712192574,
"narHash": "sha256-LbbVOliJKTF4Zl2b9salumvdMXuQBr2kuKP5+ZwbYq4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f480f9d09e4b4cf87ee6151eba068197125714de",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,13 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
outputs = { nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) just mkShell nodejs;
in {
devShells.${system}.default = mkShell { buildInputs = [ just nodejs ]; };
};
}

View file

@ -0,0 +1,9 @@
_default:
just --list
build-css:
npx tailwind --config assets/tailwind.config.ts \
--output dist/tailwind.css --minify
clean:
rm -fr node_modules dist/*

View file

@ -1,5 +1,5 @@
global-styling:
css:
base:
css/tailwind.css:
dist/tailwind.css:
minified: true

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
{
"devDependencies": {
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.12",
"tailwindcss": "^3.4.3"
}
}