Build Tailwind CSS within the theme
This commit is contained in:
parent
061a951770
commit
37589139d5
1
web/themes/custom/opdavies/.envrc
Normal file
1
web/themes/custom/opdavies/.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use flake .
|
5
web/themes/custom/opdavies/.gitignore
vendored
Normal file
5
web/themes/custom/opdavies/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
/.direnv/
|
||||||
|
/dist/*
|
||||||
|
/node_modules/
|
||||||
|
|
||||||
|
!/dist/.keep
|
39
web/themes/custom/opdavies/assets/tailwind.config.ts
Normal file
39
web/themes/custom/opdavies/assets/tailwind.config.ts
Normal 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
0
web/themes/custom/opdavies/dist/.keep
vendored
Normal file
27
web/themes/custom/opdavies/flake.lock
Normal file
27
web/themes/custom/opdavies/flake.lock
Normal 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
|
||||||
|
}
|
13
web/themes/custom/opdavies/flake.nix
Normal file
13
web/themes/custom/opdavies/flake.nix
Normal 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 ]; };
|
||||||
|
};
|
||||||
|
}
|
9
web/themes/custom/opdavies/justfile
Normal file
9
web/themes/custom/opdavies/justfile
Normal 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/*
|
|
@ -1,5 +1,5 @@
|
||||||
global-styling:
|
global-styling:
|
||||||
css:
|
css:
|
||||||
base:
|
base:
|
||||||
css/tailwind.css:
|
dist/tailwind.css:
|
||||||
minified: true
|
minified: true
|
||||||
|
|
1448
web/themes/custom/opdavies/package-lock.json
generated
Normal file
1448
web/themes/custom/opdavies/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
7
web/themes/custom/opdavies/package.json
Normal file
7
web/themes/custom/opdavies/package.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"@tailwindcss/forms": "^0.5.7",
|
||||||
|
"@tailwindcss/typography": "^0.5.12",
|
||||||
|
"tailwindcss": "^3.4.3"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue