tailwind
This commit is contained in:
parent
1405549e08
commit
c67bf28236
6 changed files with 2934 additions and 1 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -9,4 +9,6 @@ disablesignups
|
||||||
**/.pytest_cache/
|
**/.pytest_cache/
|
||||||
venv/
|
venv/
|
||||||
.vscode/
|
.vscode/
|
||||||
disablesignups
|
disablesignups
|
||||||
|
.sass-cache/
|
||||||
|
node_modules/
|
|
@ -3,6 +3,7 @@ gevent.monkey.patch_all()
|
||||||
from os import environ
|
from os import environ
|
||||||
import secrets
|
import secrets
|
||||||
from flask import *
|
from flask import *
|
||||||
|
from flask_assets import Bundle, Environment
|
||||||
from flask_caching import Cache
|
from flask_caching import Cache
|
||||||
from flask_limiter import Limiter
|
from flask_limiter import Limiter
|
||||||
from flask_compress import Compress
|
from flask_compress import Compress
|
||||||
|
@ -88,6 +89,13 @@ cache = Cache(app)
|
||||||
Compress(app)
|
Compress(app)
|
||||||
mail = Mail(app)
|
mail = Mail(app)
|
||||||
|
|
||||||
|
assets = Environment(app)
|
||||||
|
css = Bundle('src/main.css', output='dist/main.css', filters='postcss')
|
||||||
|
|
||||||
|
assets.register('css', css)
|
||||||
|
css.build()
|
||||||
|
|
||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def before_request():
|
def before_request():
|
||||||
|
|
||||||
|
|
11
files/static/tailwind.config.js
Normal file
11
files/static/tailwind.config.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
module.exports = {
|
||||||
|
purge: [],
|
||||||
|
darkMode: false, // or 'media' or 'class'
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
variants: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}
|
2889
package-lock.json
generated
Normal file
2889
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
9
package.json
Normal file
9
package.json
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"@fullhuman/postcss-purgecss": "^4.0.3",
|
||||||
|
"autoprefixer": "^10.4.0",
|
||||||
|
"postcss": "^8.4.1",
|
||||||
|
"postcss-cli": "^9.0.2",
|
||||||
|
"tailwindcss": "^2.2.19"
|
||||||
|
}
|
||||||
|
}
|
14
postcss.config.js
Normal file
14
postcss.config.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = (ctx) => ({
|
||||||
|
plugins: [
|
||||||
|
require('tailwindcss')(path.resolve(__dirname, 'tailwind.config.js')),
|
||||||
|
require('autoprefixer'),
|
||||||
|
require('@fullhuman/postcss-purgecss')({
|
||||||
|
content: [
|
||||||
|
path.resolve(__dirname, 'templates/**/*.html')
|
||||||
|
],
|
||||||
|
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || []
|
||||||
|
})
|
||||||
|
],
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue