Skip to content

Commit

Permalink
Add csslint to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Oct 27, 2023
1 parent 76816f8 commit 2f34434
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 36 deletions.
10 changes: 10 additions & 0 deletions .github/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["stylelint-config-standard"],
"rules": {
"color-hex-length": "long",
"custom-property-pattern": "^_?[\\-a-z0-9]+$",
"declaration-empty-line-before": null
},
"reportInvalidScopeDisables": true,
"reportNeedlessDisables": true
}
13 changes: 13 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,16 @@ jobs:
- run: >-
pip install yamllint==1.32.0 &&
yamllint -c .github/yamllint.yml -s .
csslint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20

- run: >-
npm install [email protected] [email protected] -g &&
stylelint "**/*.css" --config .github/.stylelintrc.json
23 changes: 11 additions & 12 deletions app/stylesheet/application.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
@import "base/vars";
@import "base/links";
@import "base/mixins";
@import "base/helpers";
@import "main_layout";
@import "misc";
@import "navbar";
@import "table";

@import "specific/artists";
@import "specific/error";
@import "specific/submission_files";
@import url("base/vars");
@import url("base/links");
@import url("base/mixins");
@import url("base/helpers");
@import url("main_layout");
@import url("misc");
@import url("navbar");
@import url("table");
@import url("specific/artists");
@import url("specific/error");
@import url("specific/submission_files");
2 changes: 1 addition & 1 deletion app/stylesheet/base/links.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ a.active {
font-weight: bold;
}

.button_to {
.button_to { /* stylelint-disable-line selector-class-pattern */
display: inline;

button {
Expand Down
1 change: 1 addition & 0 deletions app/stylesheet/base/mixins.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

.site-icon {
vertical-align: middle;

&::before {
content: "";
width: var(--_icon-size);
Expand Down
1 change: 1 addition & 0 deletions app/stylesheet/base/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
--color-table-section-darken-5: #262626;
--color-table-section-lighten-10: #4d4d4d;

/* Other miscellaneous stuff */
--border-radius-full: 6px;
}
3 changes: 1 addition & 2 deletions app/stylesheet/main_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body {
}

header {
margin: 0 0 0.8rem 0;
margin: 0 0 0.8rem;
padding: 0;
}

Expand All @@ -28,7 +28,6 @@ header {
}

footer {
margin-top: auto;
text-align: center;
border-radius: var(--border-radius-full) var(--border-radius-full) 0 0;
margin-top: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion app/stylesheet/misc.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.simple_form {
.simple_form { /* stylelint-disable-line selector-class-pattern */
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.25em 1em;
Expand Down
38 changes: 18 additions & 20 deletions app/stylesheet/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,6 @@
grid-template-columns: 3.75rem 1fr;
grid-template-areas: "logo primary" "logo secondary";

.logo {
grid-area: logo;

margin-top: 0.3rem;
background-image: url("../../public/logo.png");
background-repeat: no-repeat;
background-size: contain;
background-position-y: center;
}

.primary-navbar {
grid-area: primary;
}

.secondary-navbar {
grid-area: secondary;
}

menu {
margin: 0;
background-color: var(--color-foreground);
Expand All @@ -36,7 +18,19 @@
}
}

.logo {
grid-area: logo;

margin-top: 0.3rem;
background-image: url("../../public/logo.png");
background-repeat: no-repeat;
background-size: contain;
background-position-y: center;
}

.primary-navbar {
grid-area: primary;

margin-top: 0;
background-color: var(--color-background);

Expand All @@ -46,7 +40,11 @@
}
}

.secondary-navbar.empty li {
visibility: hidden;
.secondary-navbar {
grid-area: secondary;

&.empty li {
visibility: hidden;
}
}
}

0 comments on commit 2f34434

Please sign in to comment.