Skip to content

Commit

Permalink
Standardise colour conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 8, 2024
1 parent 3bf8de9 commit 441a440
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 156 deletions.
3 changes: 2 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"rules": {
"selector-max-id": 0,
"custom-property-pattern": null,
"selector-class-pattern": null
"selector-class-pattern": null,
"color-hex-length": "long"
}
}
2 changes: 1 addition & 1 deletion src/components/AdHocCard/AdHocCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

padding: $grid;
border-radius: $border-radius;
background-color: var(--color--bright-white);
background-color: var(--color--white);
margin-bottom: auto;
max-width: 600px;
box-shadow: $box-shadow;
Expand Down
2 changes: 1 addition & 1 deletion src/components/DiscordCard/DiscordCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

padding: $grid;
border-radius: $border-radius;
background-color: var(--color--bright-white);
background-color: var(--color--white);
margin-bottom: auto;
max-width: 600px;
box-shadow: $box-shadow;
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventCard/EventCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
flex-direction: column;
gap: 15px;
border-radius: $border-radius;
background-color: var(--color--bright-white);
background-color: var(--color--white);
margin-bottom: auto;
max-width: 600px;
box-shadow: $box-shadow;
Expand Down
10 changes: 5 additions & 5 deletions src/components/Footer/Footer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

padding-top: $grid * 2;
padding-bottom: $grid * 2;
background-color: var(--color--midnight);
background-color: var(--color--grey-80);

@include media-query(large) {
padding-top: $grid * 4;
Expand All @@ -16,7 +16,7 @@

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

.link {
Expand All @@ -25,11 +25,11 @@

font-weight: 400;
margin-top: $grid;
color: var(--color--highlight-green);
color: var(--color--green-20);

&:hover {
color: var(--color--midnight);
color: var(--color--grey-80);
text-decoration: underline;
text-decoration-color: var(--color--highlight-green);
text-decoration-color: var(--color--green-20);
}
}
17 changes: 7 additions & 10 deletions src/components/GroupListingMap/GroupListingMap.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@
display: flex;
justify-content: center;
width: 100%;
border: 1px solid var(--color--disabled-green);
border: 0.5px solid var(--color--green-20);
border-radius: $border-radius;
background: url('/images/map-toggle-background.webp'),
url('/images/map-toggle-background.png'),
linear-gradient(
var(--color--highlight-green),
var(--color--underline-green)
);
linear-gradient(var(--color--green-20), var(--color--green-30));
cursor: pointer;

&:hover {
.mapToggleButtonText {
color: var(--color--black);
background-color: var(--color--disabled-green);
background-color: var(--color--green-20);
}
}
}
Expand All @@ -41,11 +38,11 @@
justify-content: space-between;
width: max-content;
font-weight: 500;
color: var(--color--bright-white);
background-color: var(--color--dark-green);
color: var(--color--white);
background-color: var(--color--green-50);
padding: $grid * 0.5 $grid * 0.5 $grid * 0.5 $grid;
border-radius: $border-radius;
border: 1px solid var(--color--dark-gray);
border: 1px solid var(--color--grey-60);
transition: background-color 0.3s ease;
}

Expand All @@ -68,7 +65,7 @@
outline: none;

.buttonText {
outline: 3px solid var(--color--dark-green);
outline: 3px solid var(--color--green-50);
outline-offset: 3px;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/Header/Header.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

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

.link {
Expand All @@ -41,7 +41,7 @@
left: 0;
right: 0;
z-index: 2000;
background-color: var(--color--bright-white);
background-color: var(--color--white);
padding: $grid;
box-shadow: $box-shadow;
display: none;
Expand Down Expand Up @@ -82,7 +82,7 @@
.menuButton {
@include font-size(m);

color: var(--color--white);
color: var(--color--green-05);
background-color: var(--color--primary);
padding: $grid / 2;
border-radius: $border-radius;
Expand All @@ -95,11 +95,11 @@
margin-right: auto;

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

&:hover {
background-color: var(--color--highlight-green);
background-color: var(--color--green-20);
color: var(--color--text);

& svg {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Link/Link.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.link {
@include highlight-link;

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

&:hover {
color: var(--color--black);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Map/Map.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

.eventLink {
:global(.leaflet-container) & {
color: var(--color--white);
color: var(--color--green-05);
}

@include external-button-link;
Expand Down
10 changes: 5 additions & 5 deletions src/pages/Index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
border: 0;
border-radius: 3px;
padding: 8px 12px;
background-color: var(--color--dark-gray);
color: var(--color--white);
background-color: var(--color--grey-60);
color: var(--color--green-05);
font-weight: 450;

@include media-query(medium) {
Expand Down Expand Up @@ -133,8 +133,8 @@
align-items: center;
justify-content: space-between;
padding: $grid * 0.5;
background-color: var(--color--dark-green);
color: var(--color--white);
background-color: var(--color--green-50);
color: var(--color--green-05);
border: none;
border-radius: 4px;
cursor: pointer;
Expand All @@ -143,7 +143,7 @@

&:hover {
color: var(--color--black);
background-color: var(--color--disabled-green);
background-color: var(--color--green-20);
}

&:hover .filterIcon {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/events/EventPage.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@
@include focus-outline;

background-color: var(--color--primary);
color: var(--color--white);
color: var(--color--green-05);
border: none;
border-radius: $border-radius;
width: max-content;
padding: 10px 10px 8px 16px;
cursor: pointer;

& .toggleMapButton__icon path {
fill: var(--color--white);
fill: var(--color--green-05);
}

&:hover {
background-color: var(--color--highlight-green);
background-color: var(--color--green-20);
color: var(--color--text);

& .toggleMapButton__icon path {
Expand Down
95 changes: 0 additions & 95 deletions src/stories/ColourPalette.tsx

This file was deleted.

49 changes: 44 additions & 5 deletions src/stories/Colours.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
import { Meta } from '@storybook/blocks';
import ColorDocumentation from './ColourPalette.tsx';
import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';

<Meta title="Tokens/Colours" />
<Meta title="Style Guide/Colours" />

# Colour Palette
# Colours

<ColorDocumentation />
## Primary Shades

<ColorPalette>
<ColorItem
title="--color--green-50"
subtitle="The primary accent for buttons."
colors={['#1a6201']}
/>
<ColorItem
title="--color--green-30"
subtitle="Used for link underlines."
colors={['#65c783']}
/>
<ColorItem
title="--color--green-20"
subtitle="Used for text highlight & hover effects."
colors={['#8beba8']}
/>
<ColorItem
title="--color--green-05"
subtitle="The main background colour."
colors={['#f7fff8']}
/>
</ColorPalette>

## Grey Shades

<ColorPalette>
<ColorItem
title="--color--white"
subtitle="Used for the inside of cards."
colors={['#fff']}
/>
<ColorItem title="--color--grey-60" colors={['#363635']} />
<ColorItem
title="--color--grey-80"
subtitle="The colour of text."
colors={['#1c221d']}
/>
<ColorItem title="--color--black" colors={['#121613']} />
</ColorPalette>
Loading

0 comments on commit 441a440

Please sign in to comment.