Commit 8e650606 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Add stylelint

parent c10818b0
......@@ -9,7 +9,15 @@ eslint:
before_script:
- npm install
script:
- npm run lint
- npm run eslint
stylelint:
stage: test
image: node:latest
before_script:
- npm install
script:
- npm run stylelint
build_master:
stage: build
......
{
"rules": {
"color-no-invalid-hex": true,
"font-family-no-duplicate-names": true,
"font-family-no-missing-generic-family-keyword": true,
"function-calc-no-unspaced-operator": true,
"string-no-newline": true,
"unit-no-unknown": true,
"property-no-unknown": true,
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"block-no-empty": true,
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-no-unknown": true,
"selector-type-no-unknown": true,
"media-feature-name-no-unknown": true,
"at-rule-no-unknown": true,
"comment-no-empty": true,
"no-duplicate-at-import-rules": true,
"no-duplicate-selectors": true,
"no-empty-source": true,
"no-extra-semicolons": true,
"color-named": "never",
"function-url-no-scheme-relative": true,
"function-url-scheme-blacklist": ["ftp"],
"function-url-scheme-whitelist": ["data", "/^http/"],
"number-max-precision": 2,
"shorthand-property-no-redundant-values": true,
"value-no-vendor-prefix": true,
"property-no-vendor-prefix": true,
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-single-line-max-declarations": 1,
"selector-max-attribute": 2,
"selector-max-empty-lines": 0,
"selector-max-id": 2,
"selector-max-pseudo-class": 1,
"selector-max-universal": 2,
"selector-no-vendor-prefix": true,
"media-feature-name-no-vendor-prefix": true,
"at-rule-no-vendor-prefix": true,
"comment-word-blacklist": ["/^TODO/"],
"max-nesting-depth": 3,
"no-unknown-animations": true,
"color-hex-case": "lower",
"color-hex-length": "short",
"font-family-name-quotes": "always-where-recommended",
"font-weight-notation": "named-where-possible",
"function-comma-newline-after": "always-multi-line",
"function-comma-newline-before": "never-multi-line",
"function-comma-space-after": "always",
"function-comma-space-before": "never",
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never",
"function-url-quotes": ["always", {
except: ["empty"]
}],
"function-whitespace-after": "always",
"number-leading-zero": "never",
"number-no-trailing-zeros": true,
"string-quotes": "single",
"length-zero-no-unit": true,
"unit-case": "lower",
"value-keyword-case": "lower",
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-newline-before": "never-multi-line",
"value-list-comma-space-after": "always",
"value-list-comma-space-before": "never",
"value-list-max-empty-lines": 0,
"custom-property-empty-line-before": "never",
"property-case": "lower",
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-empty-line-before": "never",
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-newline-before": "never-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"block-closing-brace-empty-line-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line",
"block-opening-brace-newline-after": "always-multi-line",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-attribute-quotes": "always",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-descendant-combinator-no-non-space": true,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "single",
"selector-type-case": "lower",
"selector-list-comma-newline-after": "always-multi-line",
"selector-list-comma-newline-before": "never-multi-line",
"selector-list-comma-space-after": "never",
"selector-list-comma-space-before": "never",
"rule-empty-line-before": ["always", {
"except": ["after-single-line-comment", "first-nested"]
}],
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-name-case": "lower",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "never-multi-line",
"media-query-list-comma-newline-before": "never-multi-line",
"media-query-list-comma-space-after": "always",
"media-query-list-comma-space-before": "never",
"at-rule-empty-line-before": ["always", {
"ignore": ["after-comment", "first-nested", "blockless-after-blockless"]
}],
"at-rule-name-case": "lower",
"at-rule-name-newline-after": "always-multi-line",
"at-rule-name-space-after": "always-single-line",
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",
"comment-whitespace-inside": "always",
"indentation": 2,
"max-empty-lines": 1,
"no-eol-whitespace": true,
"no-missing-end-of-source-newline": true
}
}
\ No newline at end of file
......@@ -10,7 +10,9 @@
"start": "webpack -d --watch",
"build": "webpack -p --config webpack.config.prod.js",
"server": "webpack-dev-server --hot --inline",
"lint": "eslint src/**",
"lint": "npm run eslint && npm run stylelint",
"eslint": "eslint src/**",
"stylelint": "stylelint 'src/**/*.less' --synthax less",
"format": "prettier --write '**/*.{js,jsx}'"
},
"repository": {
......@@ -47,6 +49,7 @@
"eslint-import-resolver-webpack": "^0.9.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-prettier": "^2.6.0",
"stylelint": "^9.3.0",
"file-loader": "^1.1.11",
"less": "^3.0.4",
"less-loader": "^4.1.0",
......
......@@ -4,7 +4,7 @@
position: absolute;
top: 0;
left: 0;
background-color: yellow;
background-color: #ff0;
background-size: cover;
background-position: centre-centre;
}
......@@ -29,9 +29,9 @@ html,body {
display: grid;
grid-template-rows: auto 1fr auto;
grid-template-areas:
"header"
"content"
"footer";
'header'
'content'
'footer';
}
}
......
......@@ -2,16 +2,17 @@
#event-list {
.listview;
div {
border: none;
}
.registration {
background-color: #FFF;
background-color: #fff;
}
.upcoming {
background-color: #BBB;
background-color: #bbb;
}
.past {
......
......@@ -9,16 +9,14 @@
h2 {
text-align: center;
color: blue;
grid-column-start: 1;
grid-column-end: 13;
color: #00f;
grid-column: ~'1 / 13';
}
// Hot sector on the frontpage
.hot-row {
// Grid of 12 frame colums
grid-column-start: 1;
grid-column-end: 13;
grid-column: ~'1 / 13';
grid-row-start: 2;
// Grid declaration for sub items, 2 frame columns
......@@ -28,32 +26,29 @@
border: none;
.hot-first-card {
background-color: red;
grid-column-start: 1;
grid-column-end: 3;
grid-row-start: 1;
grid-row-end: 3;
background-color: #f00;
grid-column: ~'1 / 3';
grid-row: ~'1 / 3';
padding-top: (9 / 16) * 100%;
position: relative;
height: 0;
}
.hot-card {
grid-column: 3 / 4;
grid-column: ~'3 / 4';
position: relative;
}
}
.frontpage-row{
grid-column-start: 1;
grid-column-end: 13;
.frontpage-row {
grid-column: ~'1 / 13';
// Grid declaration for sub items, 3 frame columns
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 30px;
.frontpage-row-card{
.frontpage-row-card {
padding-top: (9 / 16) * 100%;
position: relative;
height: 0;
......
......@@ -34,21 +34,28 @@ header {
font-size: 1.2em;
z-index: 1000;
section.blue > nav {
section.grey {
height: @dimension-desktop-submenu-height;
@media @mobile {
display: none;
}
}
}
header nav {
display: grid;
grid-area: navigation;
height: @dimension-desktop-header-height;
@media @wide, @desktop {
grid-template-columns: auto 1fr auto auto auto;
grid-template-areas:
'logo main-navigation profile language-switcher';
grid-template-areas: 'logo main-navigation profile language-switcher';
}
@media @tablet {
grid-template-columns: auto 1fr auto auto;
grid-template-areas:
'logo main-navigation language-switcher';
grid-template-areas: 'logo main-navigation language-switcher';
}
@media @mobile {
......@@ -65,17 +72,18 @@ header {
max-height: 1000px;
}
}
}
.logo {
header .logo {
grid-area: logo;
height: @dimension-desktop-header-height;
@media @mobile {
height: @dimension-mobile-header-height;
}
}
}
ul {
header ul {
list-style: none;
margin: 0;
padding: 0;
......@@ -96,15 +104,15 @@ header {
border-bottom: 1px solid @color-grey;
}
}
}
}
ul.mainmenu {
header ul.mainmenu {
.mainmenu-template;
grid-area: main-navigation;
li {
&.active {
li.active {
background-color: @color-grey;
ul.submenu {
display: block;
visibility: visible;
......@@ -113,29 +121,26 @@ header {
}
@media @wide, @desktop, @tablet {
&:hover {
ul.submenu {
li:hover ul.submenu {
visibility: visible;
}
}
}
> a {
li > a {
display: block;
height: 100%;
line-height: @dimension-desktop-header-height;
padding: 0 1.3em;
color: #fff;
text-decoration: none;
}
&:hover {
li > a:hover {
color: @color-red;
}
}
}
}
}
ul.submenu {
header ul.submenu {
display: block;
visibility: hidden;
......@@ -175,24 +180,22 @@ header {
}
}
&:hover {
> a {
&:hover > a {
color: @color-red;
}
}
> a {
display: block;
height: 100%;
line-height: @dimension-desktop-submenu-height;
padding: 0 0.5em;
padding: 0 .5em;
color: #000;
text-decoration: none;
}
}
}
}
ul.profile {
header ul.profile {
.mainmenu-template;
grid-area: profile;
......@@ -207,7 +210,7 @@ header {
// border left
&:before {
content : "";
content: '';
position: absolute;
left: 0;
bottom: 25%;
......@@ -230,14 +233,14 @@ header {
}
}
}
}
}
.language-switcher {
header .language-switcher {
grid-area: language-switcher;
align-self: center;
}
}
.mobile-menu {
header .mobile-menu {
grid-area: mobile-menu;
display: none;
height: @dimension-desktop-header-height;
......@@ -251,14 +254,4 @@ header {
@media @mobile {
display: block;
}
}
}
section.grey {
height: @dimension-desktop-submenu-height;
@media @mobile {
display: none;
}
}
}
......@@ -2,12 +2,13 @@
#joboffer-list {
.listview;
div {
border: none;
}
.list-item {
border-bottom: 1px solid black;
border-bottom: 1px solid #000;
cursor: pointer;
h2 {
......@@ -18,11 +19,11 @@
}
.registration {
background-color: #FFF;
background-color: #fff;
}
.upcoming {
background-color: #BBB;
background-color: #bbb;
}
.past {
......
......@@ -2,8 +2,8 @@
text-align: center;
margin-bottom: 3em;
.contact{
margin: 3em auto 0 auto;
.contact {
margin: 3em auto 0;
> * {
display: block;
......
......@@ -8,13 +8,13 @@
}
div.content {
border: 1px solid black;
border-width: 0 1px 0 1px;
border: 1px solid #000;
border-width: 0 1px;
}
div.filter, div.details {
div.filter,div.details {
position: sticky;
top: 0px;
top: 0;
padding: 5px;
}
......@@ -29,7 +29,7 @@
grid-row: auto auto;
}
.check, .drop {
.check,.drop {
display: grid;
grid-row: auto auto;
grid-gap: 10px;
......@@ -38,7 +38,7 @@
.content {
div.list-item {
border-bottom: 1px solid black;
border-bottom: 1px solid #000;
cursor: pointer;
h2 {
......
// This file contains all allowed media queries. Only use those for responsive styling!
@mobile: ~"screen and (max-width: 880px)";
@tablet: ~"screen and (min-width: 881px) and (max-width: 1050px)";
@desktop: ~"screen and (min-width: 1051px) and (max-width: 1280px)";
@wide: ~"screen and (min-width: 1281px)";
@mobile: ~'screen and (max-width: 880px)';
@tablet: ~'screen and (min-width: 881px) and (max-width: 1050px)';
@desktop: ~'screen and (min-width: 1051px) and (max-width: 1280px)';
@wide: ~'screen and (min-width: 1281px)';
......@@ -2,6 +2,7 @@
#studydoc-list {
.listview;
div {
border: none;
}
......@@ -13,7 +14,7 @@
&:first-of-type {
font-weight: bold;
border-bottom: solid 1px black;
border-bottom: solid 1px #000;
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment