Skip to content

Commit

Permalink
Add stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 8, 2024
1 parent 6b81c39 commit 3bf8de9
Show file tree
Hide file tree
Showing 21 changed files with 1,395 additions and 291 deletions.
8 changes: 8 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["stylelint-config-standard-scss", "stylelint-config-css-modules"],
"rules": {
"selector-max-id": 0,
"custom-property-pattern": null,
"selector-class-pattern": null
}
}
1,360 changes: 1,222 additions & 138 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint && prettier --check '**/?(.)*.{md,css,scss,js,ts,tsx,json,yaml,yml}'",
"lint": "next lint && prettier --check '**/?(.)*.{md,css,scss,js,ts,tsx,json,yaml,yml}' && stylelint '**/*.scss'",
"format": "prettier --write '**/?(.)*.{md,css,scss,js,ts,tsx,json,yaml,yml}'",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
Expand Down Expand Up @@ -44,6 +44,10 @@
"axe-playwright": "^2.0.1",
"eslint-config-torchbox": "1.1.0",
"eslint-plugin-storybook": "0.8.0",
"storybook": "8.2.7"
"storybook": "8.2.7",
"stylelint": "16.8.1",
"stylelint-config-standard": "36.0.1",
"stylelint-config-standard-scss": "13.1.0",
"stylelint-config-css-modules": "4.4.0"
}
}
3 changes: 2 additions & 1 deletion src/components/AdHocCard/AdHocCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

.container {
@include font-size(s);

padding: $grid;
border-radius: $border-radius;
background-color: var(--color--bright-white);
Expand All @@ -19,5 +20,5 @@
}

.externalLink {
@include external-button-link();
@include external-button-link;
}
3 changes: 2 additions & 1 deletion src/components/DiscordCard/DiscordCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

.container {
@include font-size(s);

padding: $grid;
border-radius: $border-radius;
background-color: var(--color--bright-white);
Expand All @@ -25,5 +26,5 @@
}

.externalLink {
@include external-button-link();
@include external-button-link;
}
21 changes: 10 additions & 11 deletions src/components/EventCard/EventCard.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.details {
@include font-size(s);

padding: $grid;
display: flex;
flex-direction: column;
Expand All @@ -8,7 +9,6 @@
background-color: var(--color--bright-white);
margin-bottom: auto;
max-width: 600px;

box-shadow: $box-shadow;

@include media-query(medium) {
Expand Down Expand Up @@ -36,7 +36,7 @@

p {
color: var(--color--text);
margin: -1px 0 0 0;
margin: -1px 0 0;
}
}
}
Expand All @@ -51,23 +51,22 @@
margin-top: 0;
text-decoration: underline;

svg {
width: 1.8ex;
height: 1.8ex;
margin: 0.4ex 0 0 0.2ex;
transition: transform $transition;
}

&:hover {
color: var(--color--black);

svg {
transform: translate(0.2ex, -0.2ex);
}
}

svg {
width: 1.8ex;
height: 1.8ex;
margin: 0.4ex 0 0 0.2ex;

transition: transform $transition;
}
}

.externalLink {
@include external-button-link();
@include external-button-link;
}
7 changes: 5 additions & 2 deletions src/components/Footer/Footer.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.container {
@include main-grid();
@include main-grid;

padding-top: $grid * 2;
padding-bottom: $grid * 2;
background-color: var(--color--midnight);
Expand All @@ -12,14 +13,16 @@

.description {
@include font-size(s);

font-weight: 400;
margin-bottom: $grid / 2;
color: var(--color--white);
}

.link {
@include focus-outline-inverse();
@include focus-outline-inverse;
@include font-size(s);

font-weight: 400;
margin-top: $grid;
color: var(--color--highlight-green);
Expand Down
7 changes: 5 additions & 2 deletions src/components/GroupCard/GroupCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

.title {
@include font-size(m);
@include highlight-link();
@include highlight-link;

line-height: 1.25;
font-weight: 500;

Expand All @@ -19,14 +20,16 @@
}

&__link {
@include focus-outline;

display: inline-block;
margin-bottom: $grid;
@include focus-outline();
}
}

.description {
@include font-size(s);

font-weight: 400;
margin-bottom: $grid;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.noGroupsFoundMessage {
@include font-size(sm);

font-weight: 500;
margin-bottom: $grid * 3;
}
33 changes: 17 additions & 16 deletions src/components/GroupListingMap/GroupListingMap.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
}

.toggleButton {
@include focus-outline();
@include focus-outline;

padding: $grid;
display: flex;
justify-content: center;
Expand All @@ -34,12 +35,26 @@
}
}

.buttonText {
display: flex;
align-items: center;
justify-content: space-between;
width: max-content;
font-weight: 500;
color: var(--color--bright-white);
background-color: var(--color--dark-green);
padding: $grid * 0.5 $grid * 0.5 $grid * 0.5 $grid;
border-radius: $border-radius;
border: 1px solid var(--color--dark-gray);
transition: background-color 0.3s ease;
}

.toggleButtonOpen {
// Whenever we open the dropdown, resize the button container to nothing,
// only allowing the central button text to be clickable.
// This is because we want the placeholder background image to disappear
// and the map element to appear in its place.
background: rgba(0, 0, 0, 0);
background: rgb(0 0 0 / 0%);
height: 0;
padding: 0;
border: none;
Expand All @@ -59,20 +74,6 @@
}
}

.buttonText {
display: flex;
align-items: center;
justify-content: space-between;
width: max-content;
font-weight: 500;
color: var(--color--bright-white);
background-color: var(--color--dark-green);
padding: $grid * 0.5 $grid * 0.5 $grid * 0.5 $grid;
border-radius: $border-radius;
border: 1px solid var(--color--dark-gray);
transition: background-color 0.3s ease;
}

.dropdownIcon {
width: 24px;
height: 24px;
Expand Down
22 changes: 13 additions & 9 deletions src/components/Header/Header.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.container {
@include main-grid();
@include main-grid;

padding-top: $grid;
position: relative;

Expand All @@ -10,15 +11,17 @@

.description {
@include font-size(s);

font-weight: 400;
margin-bottom: $grid / 2;
color: var(--color--white);
}

.link {
@include highlight-link();
@include focus-outline();
@include highlight-link;
@include focus-outline;
@include font-size(sm);

font-weight: 400;
color: var(--color--text);
padding: $grid / 2;
Expand Down Expand Up @@ -78,18 +81,23 @@

.menuButton {
@include font-size(m);

color: var(--color--white);
background-color: var(--color--primary);
padding: $grid / 2;
border-radius: $border-radius;
border: none;
cursor: pointer;
font-weight: $weight--bold;
font-weight: $weight-bold;
display: flex;
align-items: center;
gap: $grid / 2;
margin-right: auto;

svg {
color: var(--color--white);
}

&:hover {
background-color: var(--color--highlight-green);
color: var(--color--text);
Expand All @@ -100,14 +108,10 @@
}

&:focus {
@include focus-outline();
@include focus-outline;
}

@include media-query(medium) {
display: none;
}

svg {
color: var(--color--white);
}
}
9 changes: 2 additions & 7 deletions src/components/Layout/Layout.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.mainContainer {
@include main-grid();
@include main-grid;

padding-top: $grid * 2;
padding-bottom: $grid * 2;

Expand All @@ -11,9 +12,3 @@
padding-top: $grid * 6;
}
}

.sidebar {
}

.content {
}
17 changes: 9 additions & 8 deletions src/components/Link/Link.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
@use 'variables' as *;

.externalLinkIcon {
vertical-align: middle;
margin-bottom: 0.35ex;
margin-left: 0.2ex;
transition: transform $transition;
}

.link {
@include highlight-link();
@include highlight-link;

color: var(--color--midnight);

&:hover {
Expand All @@ -12,10 +20,3 @@
}
}
}

.externalLinkIcon {
vertical-align: middle;
margin-bottom: 0.35ex;
margin-left: 0.2ex;
transition: transform $transition;
}
6 changes: 4 additions & 2 deletions src/components/Map/Map.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

.popupTitle {
@include font-size(s);
@include highlight-link();
@include highlight-link;

font-weight: 500;

a {
Expand All @@ -22,6 +23,7 @@

.popupText {
@include font-size(xs);

margin: $grid * 0.25 0;
}

Expand All @@ -30,7 +32,7 @@
color: var(--color--white);
}

@include external-button-link();
@include external-button-link;

font-size: 1.125rem;
font-weight: 450;
Expand Down
Loading

0 comments on commit 3bf8de9

Please sign in to comment.