Optimize css
This commit is contained in:
parent
8b49b44ebf
commit
c74b2f14a0
8 changed files with 37 additions and 24 deletions
|
|
@ -16,12 +16,18 @@
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"defaults"
|
"defaults"
|
||||||
],
|
],
|
||||||
|
"postcss": {
|
||||||
|
"plugins": {
|
||||||
|
"autoprefixer": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/socket.io-client": "^1.4.34",
|
"@types/socket.io-client": "^1.4.34",
|
||||||
"@typescript-eslint/eslint-plugin": "^3.9.1",
|
"@typescript-eslint/eslint-plugin": "^3.9.1",
|
||||||
"@typescript-eslint/parser": "^3.9.1",
|
"@typescript-eslint/parser": "^3.9.1",
|
||||||
"clean-webpack-plugin": "^3.0.0",
|
"clean-webpack-plugin": "^3.0.0",
|
||||||
"common-config-webpack-plugin": "^2.0.1",
|
"common-config-webpack-plugin": "^2.0.1",
|
||||||
|
"css-loader": "^1.0.1",
|
||||||
"eslint": "^7.2.0",
|
"eslint": "^7.2.0",
|
||||||
"eslint-config-prettier": "^6.11.0",
|
"eslint-config-prettier": "^6.11.0",
|
||||||
"eslint-plugin-import": "^2.21.2",
|
"eslint-plugin-import": "^2.21.2",
|
||||||
|
|
@ -34,10 +40,13 @@
|
||||||
"html-webpack-inline-svg-plugin": "^2.3.0",
|
"html-webpack-inline-svg-plugin": "^2.3.0",
|
||||||
"html-webpack-plugin": "^4.5.0",
|
"html-webpack-plugin": "^4.5.0",
|
||||||
"image-config-webpack-plugin": "^2.0.0",
|
"image-config-webpack-plugin": "^2.0.0",
|
||||||
|
"mini-css-extract-plugin": "^0.9.0",
|
||||||
|
"postcss-loader": "^3.0.0",
|
||||||
"prettier": "^2.0.5",
|
"prettier": "^2.0.5",
|
||||||
"resize-observer-polyfill": "^1.5.1",
|
"resize-observer-polyfill": "^1.5.1",
|
||||||
"resolve-url-loader": "^3.1.1",
|
"resolve-url-loader": "^3.1.1",
|
||||||
"scss-config-webpack-plugin": "^2.0.0",
|
"sass": "^1.27.0",
|
||||||
|
"sass-loader": "^8.0.2",
|
||||||
"sdf-2d": "^0.6.0",
|
"sdf-2d": "^0.6.0",
|
||||||
"shared": "file:../shared",
|
"shared": "file:../shared",
|
||||||
"socket.io-client": "^2.3.1",
|
"socket.io-client": "^2.3.1",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
@import './styles/vars.scss';
|
@use 'styles/vars' as *;
|
||||||
@import './styles/button.scss';
|
@use 'styles/button';
|
||||||
@import './styles/form.scss';
|
@use 'styles/form';
|
||||||
@import './styles/mixins.scss';
|
@use 'styles/mixins' as *;
|
||||||
@import './styles/settings.scss';
|
@use 'styles/settings';
|
||||||
|
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300&family=Open+Sans&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300&family=Open+Sans&display=swap');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@import './vars.scss';
|
@use './vars.scss' as *;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
border: none;
|
border: none;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
@import './vars.scss';
|
@use 'vars' as *;
|
||||||
@import './mixins.scss';
|
@use 'mixins' as *;
|
||||||
|
|
||||||
form {
|
form {
|
||||||
@include background;
|
@include background;
|
||||||
|
|
@ -38,7 +38,7 @@ form {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 15px 0 0;
|
padding: 15px 0 0;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin: 10px 0 $small-padding 0;
|
margin: 10px $small-padding / 2 $small-padding $small-padding / 2;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
|
|
@ -48,6 +48,7 @@ form {
|
||||||
padding: 10px 0 0px 0;
|
padding: 10px 0 0px 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
margin-bottom: $border-width-focused - $border-width;
|
margin-bottom: $border-width-focused - $border-width;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
&::placeholder {
|
&::placeholder {
|
||||||
color: transparent;
|
color: transparent;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
@import './vars.scss';
|
@use 'vars' as *;
|
||||||
@import './mixins.scss';
|
@use 'mixins' as *;
|
||||||
|
|
||||||
#toggle-settings-container,
|
#toggle-settings-container,
|
||||||
#settings-container {
|
#settings-container {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
const CleanWebpackPlugin = require('clean-webpack-plugin').CleanWebpackPlugin;
|
const CleanWebpackPlugin = require('clean-webpack-plugin').CleanWebpackPlugin;
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const ScssConfigWebpackPlugin = require('scss-config-webpack-plugin');
|
|
||||||
const TsConfigWebpackPlugin = require('ts-config-webpack-plugin');
|
const TsConfigWebpackPlugin = require('ts-config-webpack-plugin');
|
||||||
const HtmlWebpackInlineSVGPlugin = require('html-webpack-inline-svg-plugin');
|
const HtmlWebpackInlineSVGPlugin = require('html-webpack-inline-svg-plugin');
|
||||||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
const TerserJSPlugin = require('terser-webpack-plugin');
|
const TerserJSPlugin = require('terser-webpack-plugin');
|
||||||
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
|
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
|
||||||
|
const Sass = require('sass');
|
||||||
|
|
||||||
//const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
|
//const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
@ -18,9 +20,7 @@ module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
// Cleans the dist folder before the build starts
|
// Cleans the dist folder before the build starts
|
||||||
new CleanWebpackPlugin(),
|
new CleanWebpackPlugin(),
|
||||||
new ScssConfigWebpackPlugin(),
|
new MiniCssExtractPlugin(),
|
||||||
|
|
||||||
// Generate a base html file and injects all generated css and js files
|
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: './src/index.html',
|
template: './src/index.html',
|
||||||
inlineSource: '.(css)$',
|
inlineSource: '.(css)$',
|
||||||
|
|
@ -34,10 +34,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
//new FaviconsWebpackPlugin('static/logo.svg'),
|
|
||||||
// SCSS Configuration for .css .module.css and .scss .module.scss files
|
|
||||||
// see https://github.com/namics/webpack-config-plugins/tree/master/packages/scss-config-webpack-plugin/config
|
|
||||||
|
|
||||||
|
//new FaviconsWebpackPlugin('static/logo.svg'),
|
||||||
// Multi threading typescript loader configuration with caching for .ts and .tsx files
|
// Multi threading typescript loader configuration with caching for .ts and .tsx files
|
||||||
// see https://github.com/namics/webpack-config-plugins/tree/master/packages/ts-config-webpack-plugin/config
|
// see https://github.com/namics/webpack-config-plugins/tree/master/packages/ts-config-webpack-plugin/config
|
||||||
new TsConfigWebpackPlugin(),
|
new TsConfigWebpackPlugin(),
|
||||||
|
|
@ -61,13 +59,18 @@ module.exports = {
|
||||||
use: ['source-map-loader'],
|
use: ['source-map-loader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.scss$/i,
|
||||||
use: [
|
use: [
|
||||||
{
|
MiniCssExtractPlugin.loader,
|
||||||
loader: 'style-loader',
|
|
||||||
options: { injectType: 'singletonStyleTag' },
|
|
||||||
},
|
|
||||||
'css-loader',
|
'css-loader',
|
||||||
|
'postcss-loader',
|
||||||
|
{
|
||||||
|
loader: 'sass-loader',
|
||||||
|
options: {
|
||||||
|
sourceMap: true,
|
||||||
|
implementation: Sass,
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue