Merge pull request #485 from tordans/tailwind-jit

TailwindCSS CLI with JIT-Mode
This commit is contained in:
Pieter Vander Vennet 2021-10-01 00:10:11 +02:00 committed by GitHub
commit 03c16df41a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 4875 additions and 1247 deletions

View file

@ -18,7 +18,7 @@ export default class UserBadge extends Toggle {
const loginButton = Translations.t.general.loginWithOpenStreetMap
.Clone()
.SetClass("userbadge-login pt-3 w-full h-full")
.SetClass("userbadge-login inline-flex justify-center items-center w-full h-full text-lg font-bold min-w-[20em]")
.onClick(() => State.state.osmConnection.AttemptLogin());

View file

@ -37,7 +37,7 @@ export default class OpeningHoursRange extends BaseUIElement {
let content: BaseUIElement;
if (height > 2) {
content = new Combine([startTime, deleteRange, endTime]).SetClass("flex flex-col h-full").SetStyle("justify-content: space-between;");
content = new Combine([startTime, deleteRange, endTime]).SetClass("flex flex-col h-full justify-between");
} else {
content = new Combine([deleteRange]).SetClass("flex flex-col h-full").SetStyle("flex-content: center; overflow-x: unset;")
}

File diff suppressed because it is too large Load diff

View file

@ -33,16 +33,7 @@
}
.userbadge-login {
font-weight: bold;
font-size: large;
background-color: var(--subtle-detail-color) !important;
color: var(--subtle-detail-color-contrast);
height: 3em;
display: inline-block;
text-align: center;
margin: 0;
min-width: 20em;
pointer-events: all;
}

View file

@ -1,17 +1,18 @@
/*
TailwindCSS JIT-Mode Input file.
Use TailwindCSS functions and directives here https://tailwindcss.com/docs/functions-and-directives
About JIT-Mode: https://tailwindcss.com/docs/just-in-time-mode#styles-rebuild-in-an-infinite-loop
TailwindCSS CLI generates the css/index-tailwind-output.css file based on this file.
It is not used directly in the app.
*/
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
@variants responsive {
.max-h-65vh {
max-height: 65vh;
}
.max-h-20vh {
max-height: 20vh;
}
.z-above-map {
z-index: 10000
}
@ -19,7 +20,6 @@
.z-above-controls {
z-index: 10001
}
}
.btn {
@ -130,10 +130,6 @@ btn {
width: 4rem !important;
}
.space-between {
justify-content: space-between;
}
.link-underline a {
text-decoration: underline 1px #0078a855;;
color: #0078A8;

View file

@ -5,7 +5,6 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
<link href="./vendor/leaflet.css" rel="stylesheet"/>
<link href="./index.css" rel="stylesheet"/>
<link href="./css/userbadge.css" rel="stylesheet"/>
<link href="./css/tabbedComponent.css" rel="stylesheet"/>
<link href="./css/mobile.css" rel="stylesheet"/>
@ -14,6 +13,7 @@
<link href="css/ReviewElement.css" rel="stylesheet"/>
<link href="vendor/MarkerCluster.css" rel="stylesheet"/>
<link href="vendor/MarkerCluster.Default.css" rel="stylesheet"/>
<link href="./css/index-tailwind-output.css" rel="stylesheet" />
<meta content="website" property="og:type">
<!-- THEME-SPECIFIC -->

3724
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,10 @@
"main": "index.js",
"scripts": {
"increase-memory": "export NODE_OPTIONS=--max_old_space_size=4096",
"start": "ts-node scripts/generateLayerOverview.ts --no-fail && npm run increase-memory && parcel *.html UI/** Logic/** assets/*.json assets/svg/* assets/generated/* assets/layers/*/*.svg assets/tagRenderings/*.json assets/themes/*/*.svg assets/themes/*/*.png vendor/* vendor/*/*",
"start": "npm run start:prepare && npm-run-all --parallel start:parallel:*",
"start:prepare": "ts-node scripts/generateLayerOverview.ts --no-fail && npm run increase-memory",
"start:parallel:parcel": "parcel *.html UI/** Logic/** assets/*.json assets/svg/* assets/generated/* assets/layers/*/*.svg assets/tagRenderings/*.json assets/themes/*/*.svg assets/themes/*/*.png vendor/* vendor/*/*",
"start:parallel:tailwindcli": "tailwindcss -i index.css -o css/index-tailwind-output.css --watch",
"test": "ts-node test/TestAll.ts",
"init": "npm ci && npm run generate && npm run generate:editor-layer-index && npm run generate:layouts && npm run clean",
"add-weblate-upstream": "git remote add weblate-layers https://hosted.weblate.org/git/mapcomplete/layer-translations/ ; git remote update weblate-layers",
@ -51,7 +54,6 @@
"license": "GPL",
"dependencies": {
"@babel/preset-env": "7.13.8",
"@tailwindcss/postcss7-compat": "^2.0.2",
"@turf/buffer": "^6.3.0",
"@turf/collect": "^6.3.0",
"@turf/distance": "^6.3.0",
@ -63,7 +65,6 @@
"@types/leaflet.markercluster": "^1.4.3",
"@types/lz-string": "^1.3.34",
"@types/prompt-sync": "^4.1.0",
"autoprefixer": "^9.8.6",
"country-language": "^0.1.7",
"email-validator": "^2.0.4",
"escape-html": "^1.0.3",
@ -80,12 +81,13 @@
"lz-string": "^1.4.4",
"mangrove-reviews": "^0.1.3",
"moment": "^2.29.0",
"npm-run-all": "^4.1.5",
"opening_hours": "^3.6.0",
"osm-auth": "^1.0.2",
"osmtogeojson": "^3.0.0-beta.4",
"parcel": "^1.2.4",
"postcss": "^7.0.36",
"prompt-sync": "^4.2.0",
"tailwindcss": "^2.2.15",
"tslint": "^6.1.3"
},
"devDependencies": {
@ -96,7 +98,6 @@
"marked": "^2.0.0",
"read-file": "^0.2.0",
"sharp": "^0.28.3",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.7",
"ts-node": "^9.0.0",
"ts-node-dev": "^1.0.0-pre.63",
"tslint-no-circular-imports": "^0.7.0",

View file

@ -1,6 +0,0 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}

View file

@ -1,9 +1,10 @@
const plugin = require('tailwindcss/plugin')
module.exports = {
mode: 'jit',
purge: [
// './**/*.html',
// './**/*.js',
'./**/*.html',
'./**/*.ts',
],
darkMode: false, // or 'media' or 'class'
theme: {
@ -20,9 +21,9 @@ module.exports = {
}
},
plugins: [
plugin(function ({addVariant, e}) {
addVariant('landscape', ({modifySelectors, separator}) => {
modifySelectors(({className}) => {
plugin(function ({ addVariant, e }) {
addVariant('landscape', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.${e(`landscape${separator}${className}`)}:landscape`
})
})