Skip to content

Commit

Permalink
TIDY UP: Sass files/clean up (#684)
Browse files Browse the repository at this point in the history
## What's Changed?

- Made all remaining `.css` files into `.scss` files
- Deleted some blank `.css` files
- Switched all `css` variables to `scss` variables and refactored base
stylesheets accordingly
- Switched all `@import` statements to `@use` statements
- Switched (almost) all quotes in `scss` files to single quotes for the
sake of consistency (except where this breaks things)

closes #679

---------

Co-authored-by: loiswells97 <[email protected]>
Co-authored-by: Lois Wells <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2023
1 parent 4cf4e1c commit 4af5e36
Show file tree
Hide file tree
Showing 55 changed files with 209 additions and 186 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed

- Tidied up stylesheets (#684)

## [0.19.1]

### Fixed
Expand Down
14 changes: 7 additions & 7 deletions src/App.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "./tabs.scss";
@use "./font-size" as *;
@use "./colours.scss" as *;
@use './tabs' as *;
@use './font-size' as *;
@use './colours' as *;

a {
border: 3px solid transparent;
Expand All @@ -20,8 +20,8 @@ button {
}

input {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
}

Expand Down Expand Up @@ -56,8 +56,8 @@ input {
#app {
display: flex;
flex-flow: column;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
@include font-size-1(regular);
}
Expand Down
14 changes: 8 additions & 6 deletions src/Modal.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@use './spacing' as *;
@use './font-size' as *;
@import './colours.scss';
@import './mixins.scss';
@use './font-weight' as *;
@use './line-height' as *;
@use './colours' as *;
@use './mixins' as *;

.modal-overlay {
display: flex;
Expand All @@ -23,7 +25,7 @@
flex-direction: column;

label, legend {
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
}

input[type=text] {
Expand Down Expand Up @@ -70,17 +72,17 @@
.modal-content__subheading {
@include font-size-1(regular);
margin: 0;
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
}

.modal-content__text {
margin: 0;
line-height: var(--line-height-regular);
line-height: $line-height-regular;
}

.modal-content__help-text {
margin: $space-0-25 0;
font-weight: var(--font-weight-regular);
font-weight: $font-weight-regular;
}

.modal-content__inputs {
Expand Down
23 changes: 12 additions & 11 deletions src/components/AstroPiModel/AstroPiModel.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use "../../spacing" as *;
@use "../../font-size" as *;
@import "../../colours.scss";
@use '../../spacing' as *;
@use '../../font-size' as *;
@use '../../font-weight' as *;
@use '../../colours' as *;

.sense-hat {
width: 100%;
Expand Down Expand Up @@ -40,7 +41,7 @@
@include font-size-0-75(regular);
flex: 1;
text-transform: uppercase;
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
margin: 0 $space-0-5;
}

Expand All @@ -67,7 +68,7 @@

&-heading {
@include font-size-1(regular);
font-weight: var(--font-weight-base);
font-weight: $font-weight-regular;
margin: 0;
margin-bottom: $space-0-5;
}
Expand Down Expand Up @@ -98,7 +99,7 @@
display: flex;
align-items: center;
justify-content: center;
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;

&-timer {
Expand Down Expand Up @@ -128,7 +129,7 @@
transform: rotate(270deg);
}

input[type="color"] {
input[type='color'] {
border-radius: 5px;
flex: 1;
width: 100%;
Expand Down Expand Up @@ -192,15 +193,15 @@

&-panel {
&__control {
box-shadow: inset 0 0 var(--spacing-2) $rpf-grey-700;
box-shadow: inset 0 0 $space-3 $rpf-grey-700;
background-color: $rpf-grey-700;

&-reading {
background-color: $rpf-grey-800;
border: 1px solid $rpf-grey-500;
}

input[type="color"] {
input[type='color'] {
background-color: $rpf-grey-800;
border: 1px solid $rpf-grey-500;
}
Expand Down Expand Up @@ -246,15 +247,15 @@

&-panel {
&__control {
box-shadow: inset 0 0 var(--spacing-2) $rpf-grey-100;
box-shadow: inset 0 0 $space-3 $rpf-grey-100;
background-color: $rpf-grey-50;

&-reading {
background-color: $rpf-grey-100;
border: 2px solid $rpf-grey-300;
}

input[type="color"] {
input[type='color'] {
background-color: $rpf-white;
border: 2px solid $rpf-grey-300;
}
Expand Down
9 changes: 5 additions & 4 deletions src/components/BetaBanner/BetaBanner.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use "../../spacing" as *;
@import "../../colours.scss";
@use '../../spacing' as *;
@use '../../font-weight' as *;
@use '../../colours' as *;

.editor-banner {
display: flex;
Expand All @@ -19,7 +20,7 @@
padding: $space-0-25;
border-radius: 8px;
background-color: $rpf-teal-200;
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
margin-right: $space-1-5;
}
}
Expand All @@ -30,7 +31,7 @@

.editor-banner__link {
display: inline;
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
padding-left: 0;
padding-right: 0;
text-decoration: underline;
Expand Down
5 changes: 3 additions & 2 deletions src/components/Button/Button.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use '../../spacing' as *;
@import '../../colours.scss';
@use '../../font-weight' as *;
@use '../../colours' as *;

@mixin button-styling($bg, $active-bg, $dis-bg, $dis-c, $focus-bg, $hover-bg, $c: default) {
background-color: $bg;
Expand Down Expand Up @@ -53,7 +54,7 @@
display: inline-flex;
font-family: sans-serif;
font-size: inherit;
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
gap: $space-0-5;
justify-content: center;
margin: 6px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/DesignSystemButton/DesignSystemButton.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '../../colours.scss' as *;
@use '../../colours' as *;

:root * {
--rpf-button-primary-background-color: #{$rpf-teal-primary-default};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor/DraggableTabs/DraggableTabs.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "../../../colours" as *;
@use '../../../colours' as *;
@use '../../../spacing' as *;

.draggable-tab {
Expand Down
1 change: 0 additions & 1 deletion src/components/Editor/Editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import './editor.css'
import React, { useRef, useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import { update } from "./EditorSlice";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "./ImageUploadButton.css";
import "./ImageUploadButton.scss";

import { useCallback, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use '../../../font-weight' as *;

.dropzone-area {
border: 1px dashed black;
border-radius: 10px;
Expand All @@ -6,7 +8,7 @@
}

.dropzone-info {
font-weight: bold;
font-weight: $font-weight-bold;
}

.modal-footer {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Editor/Project/Project.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use "../../../spacing" as *;
@use "../../../colours" as *;
@use '../../../spacing' as *;
@use '../../../colours' as *;

.proj {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor/Runners/HtmlRunner/HtmlRunner.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '../../../../colours' as *;
@import '../../../../mixins.scss';
@use '../../../../mixins' as *;

.htmlrunner-container {
container-type: inline-size;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '../../../../spacing' as *;
@import '../../../../colours.scss';
@use '../../../../colours' as *;

.output-view-toggle__button {
height: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '../../../../spacing' as *;
@use '../../../../font-size' as *;
@import '../../../../colours.scss';
@use '../../../../colours' as *;

.pythonrunner-container {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmbeddedViewer/EmbeddedViewer.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../colours.scss';
@use '../../colours' as *;

.embedded-viewer {
display: flex;
Expand Down
7 changes: 4 additions & 3 deletions src/components/GlobalNav/GlobalNav.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '../../spacing' as *;
@import '../../colours.scss';
@import '../../mixins.scss';
@use '../../font-weight' as *;
@use '../../colours' as *;
@use '../../mixins' as *;

.editor-global-nav-wrapper {
flex: 0 1 auto;
Expand Down Expand Up @@ -45,7 +46,7 @@
align-items: center;
margin-left: $space-2;
padding: $space-0-5 0;
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
text-decoration: none;
color: $rpf-white;

Expand Down
19 changes: 10 additions & 9 deletions src/components/LandingPage/LandingPage.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@use "../../spacing" as *;
@use "../../font-size" as *;
@import "../../colours.scss";
@import "../../mixins.scss";
@use '../../spacing' as *;
@use '../../font-size' as *;
@use '../../font-weight' as *;
@use '../../colours' as *;
@use '../../mixins' as *;

.landing-page-wrapper {
display: flex;
Expand Down Expand Up @@ -35,7 +36,7 @@

.landing-page__projects--subtitle {
@include font-size-1-5(regular);
font-weight: var(--font-weight-regular);
font-weight: $font-weight-regular;
margin: $space-1;

@media screen and (min-width: 375px) {
Expand All @@ -46,7 +47,7 @@
.landing-page__projects--login {
@include font-size-1-25(regular);
button {
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
padding: 0;
text-decoration: underline;
}
Expand Down Expand Up @@ -81,7 +82,7 @@

.landing-page__paths--title {
@include font-size-1-5(regular);
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
}

.landing-page__button * {
Expand All @@ -98,13 +99,13 @@

.landing-page__paths--start {
@include font-size-1-5(regular);
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
}

.landing-page__paths--description {
@include font-size-1(regular);
a {
font-weight: var(--font-weight-bold);
font-weight: $font-weight-bold;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Menus/ContextMenu/ContextMenu.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '../../../spacing' as *;
@import '../../../colours.scss';
@use '../../../colours' as *;

.context-menu__drop {
display: flex;
Expand Down
5 changes: 3 additions & 2 deletions src/components/Menus/Dropdown/Dropdown.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use '../../../spacing' as *;
@import '../../../colours.scss';
@use '../../../font-weight' as *;
@use '../../../colours' as *;

.dropdown {
display: flex;
Expand Down Expand Up @@ -52,7 +53,7 @@
cursor: pointer;
font: inherit;
justify-content: left;
font-weight: var(--font-weight-regular);
font-weight: $font-weight-regular;
text-decoration: none;
padding: $space-0-5 $space-0-25;
border-radius: 5px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menus/FileMenu/FileMenu.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '../../../spacing' as *;
@import '../../../colours.scss';
@use '../../../colours' as *;

.file-menu__drop {
display: flex;
Expand Down
Loading

0 comments on commit 4af5e36

Please sign in to comment.