Merge css with postcss

This commit is contained in:
Christoph Reiter
2019-06-04 08:55:25 +02:00
parent 3570af20f1
commit ac1f48a135
7 changed files with 57 additions and 63 deletions

View File

@@ -1 +1,3 @@
import 'bootstrap/dist/css/bootstrap.css';
import './style.css';
import 'bootstrap';

View File

@@ -4,14 +4,13 @@
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-copy": "^2.0.1",
"rollup-plugin-node-resolve": "^5.0.0",
"rollup-plugin-terser": "^5.0.0"
},
"dependencies": {
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-terser": "^5.0.0",
"bootstrap": "^4.3.1",
"jquery": "^3.4.1",
"popper.js": "^1.15.0",
"rollup-plugin-uglify": "^6.0.2"
"popper.js": "^1.15.0"
},
"dependencies": {},
"scripts": {
"build": "rollup --config",
"dev": "rollup --config --watch"

View File

@@ -1,7 +1,7 @@
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import copy from 'rollup-plugin-copy';
import {terser} from "rollup-plugin-terser";
import postcss from 'rollup-plugin-postcss'
const dev = process.env.ROLLUP_WATCH === 'true';
@@ -14,13 +14,10 @@ export default {
plugins: [
resolve(),
commonjs(),
!dev && terser(),
copy({
targets: [
'./node_modules/bootstrap/dist/css/bootstrap.min.css',
],
outputFolder: 'static/css',
warnOnNonExist: true
postcss({
extract: 'static/css/index.css',
minimize: true,
}),
!dev && terser(),
],
};

File diff suppressed because one or more lines are too long

6
static/css/index.css Normal file

File diff suppressed because one or more lines are too long

39
style.css Normal file
View File

@@ -0,0 +1,39 @@
body {
padding-top: 4.45rem;
}
.navbar {
border-bottom: 1px solid rgba(0,0,0,.125);
}
.container-fluid .nav .nav-link {
color: #888;
}
.container-fluid .nav .nav-link.active {
color: #000;
}
dl ul {
margin-bottom: 0;
}
.sticky-top {
top: 5rem;
}
@media (max-width: 992px) {
html {
font-size: 0.9em;
}
.container {
max-width: initial;
}
}
@media (max-width: 576px) {
html {
font-size: 0.8em;
}
}

View File

@@ -5,49 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}"/>
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
<style>
body {
padding-top: 4.45rem;
}
.navbar {
border-bottom: 1px solid rgba(0,0,0,.125);
}
.container-fluid .nav .nav-link {
color: #888;
}
.container-fluid .nav .nav-link.active {
color: #000;
}
dl ul {
margin-bottom: 0;
}
.sticky-top {
top: 5rem;
}
@media (max-width: 992px) {
html {
font-size: 0.9em;
}
.container {
max-width: initial;
}
}
@media (max-width: 576px) {
html {
font-size: 0.8em;
}
}
</style>
<link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
</head>
<body>
<nav class="navbar navbar-expand-md navbar-light fixed-top bg-light">