From c8cab949e97ca0f380487311a9d1f4983cd0c69d Mon Sep 17 00:00:00 2001
From: edith <58082567+jellodiil@users.noreply.github.com>
Date: Mon, 3 Jun 2024 22:56:39 +0800
Subject: [PATCH 01/19] WEB-6747: Tweaking some base stuff
---
app/server/views/styles/abstracts/colors.scss | 127 +++++++++++++++
.../views/styles/abstracts/functions.scss | 10 ++
.../styles/components/written_content.scss | 146 ++++++++++++++++++
3 files changed, 283 insertions(+)
create mode 100644 app/server/views/styles/abstracts/colors.scss
create mode 100644 app/server/views/styles/abstracts/functions.scss
create mode 100644 app/server/views/styles/components/written_content.scss
diff --git a/app/server/views/styles/abstracts/colors.scss b/app/server/views/styles/abstracts/colors.scss
new file mode 100644
index 0000000..051d358
--- /dev/null
+++ b/app/server/views/styles/abstracts/colors.scss
@@ -0,0 +1,127 @@
+/**
+ * This file contains all colour definitions.
+ *
+ * 1. Colours
+ * 2. Highlighter Colours
+ *
+ */
+
+/* ==========================================================================
+ 1. Colours
+========================================================================== */
+
+/* Black */
+
+$black-night: #14161E;
+$black-night-hover: #43454B;
+
+// Dark mode
+$black-phantom: #0E0F14;
+$black-jaguar: #07080A; /* Dark mode input */
+$black-iridium: #3B3D43; /* Dark mode hover */
+$black-plaza: #30363D; /* Dark mode borders */
+
+/* Grey */
+
+$grey-thought: #D7D7D7; /* Main Brand Grey */
+$grey-thought-20: #D7D7D733; /*Main Brand Grey at 20% opacity */
+$grey-thought-50: #D7D7D77F; /*Main Brand Grey at 50% opacity */
+$grey-wisp: #F7F7F7; /* Brand Light Grey */
+$grey-london: #AC9FAB; /* Light Multi-platform Colour */
+$grey-taupe: #5F4F5E; /* Dark Multi-platform Colour */
+
+/* Red */
+
+$red-lychee: #E34A4C;
+$red-lipstick: #962224;
+
+/* Pink */
+
+$pink-doll: #F26FAA; /* Light Server-Side Swift Colour */
+$pink-peony: #A53B6B; /* Dark Server-Side Swift Colour */
+$pink-peach: #E6978A;
+$pink-incense: #99584D;
+
+/* Orange */
+
+$orange-glow: #FF5A00; /* Main Brand Colour */
+$orange-enthusiasm: #FF8847; /* Brand Light Orange */
+$orange-enthusiasm-20: #FF884733; /* Brand Light Orange with 20% opacity */
+$orange-determination: #CE3F00; /* Brand Dark Orange */
+$orange-raw-sienna: #CF7F42;
+$orange-burnt: #82491D;
+
+/* Yellow */
+
+$yellow-autumn: #E3A93D; /* Light Pro-Gro Colour */
+$yellow-curry: #966B19; /* Dark Pro-Gro Colour */
+
+/* Green */
+
+$green-meadow: #00B87E; /* Light Android Colour */
+$green-meadow-50: #00B87E80; /* Light Android 50% opacity */
+$green-meadow-dark: #0F553E; /* Light Android colour equivalent for 50% opacity on dark background */
+$green-rainforest: #157857; /* Dark Android Colour */
+$green-celery: #AEB740;
+$green-cypress: #575C20;
+$green-olive: #778749;
+$green-kelp: #3C4425;
+
+/* Blue */
+
+$blue-sky : #2EA4DD; /* Light Flutter Colour */
+$blue-sky-50 : #2EA4DD80;/* Light Flutter 50% opacity */
+$blue-sky-dark : #1B4A6B;/* Light Flutter colour equivalent for 50% opacity on dark background */
+$blue-sea: #106790; /* Dark Flutter Colour */
+$blue-cornflower : #597CEE;
+$blue-denim : #2C48A1;
+
+/* Purple */
+
+$purple-iolite: #8763D2; /* Light iOS Colour */
+$purple-iolite-50: #8763D280;/* Light iOS 50% opacity */
+$purple-iolite-dark: #3C2C64; /* Light iOS colour equivalent for 50% opacity on dark background */
+$purple-amethyst: #4D3285; /* Dark iOS Colour */
+$purple-almost-fuchsia: #B44EBF; /* Light Game Tech Colour */
+$purple-regal: #6B2372; /* Dark Game Tech Colour */
+
+/* White */
+
+$white: #FFFFFF;
+
+/* Transparent */
+
+$transparent: transparent;
+
+/* ==========================================================================
+ 2. Highlighter Colours
+========================================================================== */
+
+$hljs-bright-grey: #999999;
+$hljs-bright-red: #F64E1A;
+$hljs-bright-orange: #F08D49;
+$hljs-bright-yellow: #F8C555;
+$hljs-bright-green: #7EC699;
+$hljs-bright-aqua: #18B5AB;
+$hljs-bright-blue: #70A2FF;
+$hljs-bright-purple: #CC99CD;
+
+$hljs-pastel-grey: #9FA4B1;
+$hljs-pastel-red: #F37957;
+$hljs-pastel-orange: #F5AB57;
+$hljs-pastel-yellow: #F8C555;
+$hljs-pastel-green: #86AD85;
+$hljs-pastel-aqua: #5FB3B3;
+$hljs-pastel-blue: #6293C3;
+$hljs-pastel-purple: #C192C1;
+
+$hljs-light-grey: #918791;
+$hljs-light-red: #E34A4C;
+$hljs-light-orange: #FF5A00;
+$hljs-light-yellow: #966B19;
+$hljs-light-green: #157857;
+$hljs-light-aqua: #1D7EAF;
+$hljs-light-blue: #2E5FFF;
+$hljs-light-purple: #6B2372;
+
+
diff --git a/app/server/views/styles/abstracts/functions.scss b/app/server/views/styles/abstracts/functions.scss
new file mode 100644
index 0000000..15590dc
--- /dev/null
+++ b/app/server/views/styles/abstracts/functions.scss
@@ -0,0 +1,10 @@
+@use "sass:math";
+@use "../01-settings/fonts";
+
+/* Function to convert pixel font sizes to rem */
+@function px2rem($size) {
+ @if math.unit($size) != 'px' {
+ @error "The size argument (#{$size}) must be in pixels.";
+ }
+ @return math.div($size, fonts.$base-font-size) * 1rem;
+}
diff --git a/app/server/views/styles/components/written_content.scss b/app/server/views/styles/components/written_content.scss
new file mode 100644
index 0000000..193cf0c
--- /dev/null
+++ b/app/server/views/styles/components/written_content.scss
@@ -0,0 +1,146 @@
+/**
+ * .written_content is a wrapper class that will format standard things like
+ * p, h1, h2, blockquote etc. Used in things like articles.
+ *
+ */
+
+ @use '../01-settings/colors';
+ @use '../01-settings/fonts';
+ @use '../06-tools/functions' as f;
+ @use '../06-tools/mixins';
+
+
+ .written-content {
+
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6 {
+ margin-top: 48px;
+ word-break: break-word;
+ }
+
+ h1,
+ h2 {
+ font-size: f.px2rem(32px);
+
+ @include mixins.mobile {
+ font-size: f.px2rem(28px);
+ }
+ }
+
+ h3 {
+ font-size: f.px2rem(24px);
+ }
+
+ h4 {
+ font-size: f.px2rem(20px);
+ }
+
+ h5,
+ h6 {
+ font-size: f.px2rem(16px);
+ }
+
+ p, ul, ol, .note {
+ font-family: fonts.$system;
+ font-size: f.px2rem(16px);
+ line-height: 1.66;
+ word-break: break-word;
+ }
+
+ p {
+ margin-top: 20px;
+ }
+
+ a {
+ color: colors.$orange-determination;
+ }
+
+ em {
+ font-weight: 700;
+ font-style: normal;
+ }
+
+ code {
+ background-color: rgba(colors.$grey-thought, 0.25);
+ border: 1px solid colors.$grey-thought;
+ padding: 1px 8px;
+ font-size: f.px2rem(15px);
+ border-radius: 8px;
+ }
+
+ pre {
+ margin-top: 24px;
+
+ code {
+ padding: 24px;
+ }
+ }
+
+ pre + p, pre + ul, pre + ol {
+ margin-top: 24px;
+ }
+
+ .note,
+ blockquote {
+ margin-top: 24px;
+ padding: 24px;
+ border: 1px solid colors.$orange-glow;
+ background-color: colors.$white;
+ border-radius: 16px;
+ }
+
+ ul {
+ margin-top: 4px;
+ list-style: none;
+
+ li {
+ position: relative;
+ margin-top: 16px;
+ padding-left: 40px;
+ line-height: 1.66;
+
+ &::before {
+ content: "\200B";
+ background-color: colors.$orange-enthusiasm;
+ display: inline-block;
+ height: 8px;
+ width: 8px;
+ border-radius: 2px;
+ position: absolute;
+ top: 9px;
+ left: 16px;
+ }
+ }
+ }
+
+ ol {
+ margin-top: 20px;
+ padding-left: 20px;
+ list-style: number;
+
+ li {
+ position: relative;
+ margin-top: 12px;
+ padding-top: 4px;
+ line-height: 1.66;
+ }
+ }
+
+ img {
+ padding: 8px;
+ border-radius: 16px;
+ margin: 40px auto;
+ max-width: 100%;
+ height: auto;
+ display: block;
+ }
+
+ img.bordered {
+ border: 1px solid colors.$black-night;
+ }
+
+ }
From fd021fbb7d84524eccab09f80025cc53927e4275 Mon Sep 17 00:00:00 2001
From: edith <58082567+jellodiil@users.noreply.github.com>
Date: Mon, 3 Jun 2024 22:57:02 +0800
Subject: [PATCH 02/19] WEB-6747: Adds svgs
---
.../public/images/svg-icons/approved-script-checked.svg | 3 +++
app/server/public/images/svg-icons/change.svg | 9 +++++++++
.../public/images/svg-icons/checkmark-completed.svg | 3 +++
app/server/public/images/svg-icons/chevron-outline.svg | 3 +++
app/server/public/images/svg-icons/clock.svg | 3 +++
app/server/public/images/svg-icons/layers.svg | 3 +++
app/server/public/images/svg-icons/line-graph.svg | 3 +++
7 files changed, 27 insertions(+)
create mode 100644 app/server/public/images/svg-icons/approved-script-checked.svg
create mode 100644 app/server/public/images/svg-icons/change.svg
create mode 100644 app/server/public/images/svg-icons/checkmark-completed.svg
create mode 100644 app/server/public/images/svg-icons/chevron-outline.svg
create mode 100644 app/server/public/images/svg-icons/clock.svg
create mode 100644 app/server/public/images/svg-icons/layers.svg
create mode 100644 app/server/public/images/svg-icons/line-graph.svg
diff --git a/app/server/public/images/svg-icons/approved-script-checked.svg b/app/server/public/images/svg-icons/approved-script-checked.svg
new file mode 100644
index 0000000..17808be
--- /dev/null
+++ b/app/server/public/images/svg-icons/approved-script-checked.svg
@@ -0,0 +1,3 @@
+
diff --git a/app/server/public/images/svg-icons/change.svg b/app/server/public/images/svg-icons/change.svg
new file mode 100644
index 0000000..6f3bdc9
--- /dev/null
+++ b/app/server/public/images/svg-icons/change.svg
@@ -0,0 +1,9 @@
+
diff --git a/app/server/public/images/svg-icons/checkmark-completed.svg b/app/server/public/images/svg-icons/checkmark-completed.svg
new file mode 100644
index 0000000..ec5fb2d
--- /dev/null
+++ b/app/server/public/images/svg-icons/checkmark-completed.svg
@@ -0,0 +1,3 @@
+
diff --git a/app/server/public/images/svg-icons/chevron-outline.svg b/app/server/public/images/svg-icons/chevron-outline.svg
new file mode 100644
index 0000000..2bfca56
--- /dev/null
+++ b/app/server/public/images/svg-icons/chevron-outline.svg
@@ -0,0 +1,3 @@
+
diff --git a/app/server/public/images/svg-icons/clock.svg b/app/server/public/images/svg-icons/clock.svg
new file mode 100644
index 0000000..cfe14c9
--- /dev/null
+++ b/app/server/public/images/svg-icons/clock.svg
@@ -0,0 +1,3 @@
+
diff --git a/app/server/public/images/svg-icons/layers.svg b/app/server/public/images/svg-icons/layers.svg
new file mode 100644
index 0000000..86f8b40
--- /dev/null
+++ b/app/server/public/images/svg-icons/layers.svg
@@ -0,0 +1,3 @@
+
diff --git a/app/server/public/images/svg-icons/line-graph.svg b/app/server/public/images/svg-icons/line-graph.svg
new file mode 100644
index 0000000..e95caa6
--- /dev/null
+++ b/app/server/public/images/svg-icons/line-graph.svg
@@ -0,0 +1,3 @@
+
From 9a95bf87751172893b3c73cea73a1c7d6432746b Mon Sep 17 00:00:00 2001
From: edith <58082567+jellodiil@users.noreply.github.com>
Date: Mon, 3 Jun 2024 22:58:15 +0800
Subject: [PATCH 03/19] WEB-6747: More changes to base things
---
.../views/styles/abstracts/functions.scss | 2 +-
app/server/views/styles/abstracts/mixins.scss | 57 +++++++++++++++++--
.../views/styles/abstracts/variables.scss | 4 ++
app/server/views/styles/base/base.scss | 4 +-
app/server/views/styles/base/typography.scss | 23 ++++----
.../styles/components/written_content.scss | 38 ++++++-------
6 files changed, 85 insertions(+), 43 deletions(-)
diff --git a/app/server/views/styles/abstracts/functions.scss b/app/server/views/styles/abstracts/functions.scss
index 15590dc..4bf86d2 100644
--- a/app/server/views/styles/abstracts/functions.scss
+++ b/app/server/views/styles/abstracts/functions.scss
@@ -1,5 +1,5 @@
@use "sass:math";
-@use "../01-settings/fonts";
+@use "../abstracts/fonts";
/* Function to convert pixel font sizes to rem */
@function px2rem($size) {
diff --git a/app/server/views/styles/abstracts/mixins.scss b/app/server/views/styles/abstracts/mixins.scss
index e814436..9f09652 100644
--- a/app/server/views/styles/abstracts/mixins.scss
+++ b/app/server/views/styles/abstracts/mixins.scss
@@ -23,9 +23,9 @@
border-radius: $border-radius;
}
- /* ==========================================================================
+/* ==========================================================================
2. Breakpoints
- ========================================================================== */
+========================================================================== */
@mixin breakpoint($minWidth: 0, $maxWidth: 0, $minHeight: 0, $maxHeight: 0) {
$type: type-of($minWidth);
@@ -113,8 +113,8 @@
}
/* ==========================================================================
- 3. Pseudo element absolute
- ========================================================================== */
+ 3. Pseudo element absolute
+========================================================================== */
@mixin pseudo-absolute{
position: relative;
@@ -130,9 +130,9 @@
}
}
- /* ==========================================================================
+/* ==========================================================================
4. Border Hover
- ========================================================================== */
+========================================================================== */
@mixin link-border{
transition: border 0s;
@@ -159,3 +159,48 @@
scrollbar-width: none;
&::-webkit-scrollbar { width: 0 !important }
}
+
+/* ==========================================================================
+ 7. Truncation
+========================================================================== */
+
+@mixin truncate($num_lines) {
+ display: -webkit-box;
+ -webkit-line-clamp: $num_lines;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+
+/* ==========================================================================
+ 8. Flexed spacing
+========================================================================== */
+
+ @mixin stacked($spacing) {
+ display: flex;
+ align-items: center;
+ column-gap: $spacing;
+ }
+
+
+/* ==========================================================================
+ 9. Aspect Ratio
+========================================================================== */
+
+@mixin aspect-ratio($ratio) {
+ position: relative;
+ overflow: hidden;
+
+ &::before {
+ content: '';
+ display: inline-block;
+ padding-bottom: $ratio * 100%;
+ }
+
+ > * {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
+}
diff --git a/app/server/views/styles/abstracts/variables.scss b/app/server/views/styles/abstracts/variables.scss
index 09eab26..b47460c 100644
--- a/app/server/views/styles/abstracts/variables.scss
+++ b/app/server/views/styles/abstracts/variables.scss
@@ -22,6 +22,10 @@
$header-3: "Bitter", serif;
$monospace: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
$article: "IBM Plex Serif", serif;
+ $base: 'Relative';
+ $mono: 'Relative Mono';
+ $base-font-size: 16px;
+ $system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
/* ==========================================================================
diff --git a/app/server/views/styles/base/base.scss b/app/server/views/styles/base/base.scss
index ad17074..e271498 100644
--- a/app/server/views/styles/base/base.scss
+++ b/app/server/views/styles/base/base.scss
@@ -5,7 +5,7 @@
html {
box-sizing: border-box;
- font-family: $body;
+ font-family: $base;
}
*,
@@ -37,7 +37,7 @@ button {
background: transparent;
border: 0;
padding: 0;
- font-family: $body;
+ font-family: $base;
}
fieldset {
diff --git a/app/server/views/styles/base/typography.scss b/app/server/views/styles/base/typography.scss
index 2bdf262..58a71fa 100644
--- a/app/server/views/styles/base/typography.scss
+++ b/app/server/views/styles/base/typography.scss
@@ -3,12 +3,12 @@
*/
body{
- font-family: $body;
+ font-family: $base;
font-display: auto;
font-size: 1rem;
- font-weight: normal;
- line-height: 1.45;
- color: $black-mine-shaft;
+ font-weight: 400;
+ line-height: 1.5;
+ color: $black-night;
-webkit-backface-visibility: hidden;
text-shadow: 0 -1px 1px rgba(255, 255, 255, 0.01);
-moz-osx-font-smoothing: grayscale;
@@ -17,15 +17,15 @@ body{
}
h1, h2, h3, h4, h5{
- font-family: $header;
+ font-family: $base;
font-display: auto;
- font-weight: 700;
- letter-spacing: -.5px;
+ font-weight: 400;
+ line-height: 1.25;
+ letter-spacing: unset;
}
h1{
font-size: 3rem;
- line-height: 1.125;
@include breakpoint("mobile"){
font-size: 1.875rem;
@@ -35,24 +35,21 @@ h1{
h2{
font-size: 1.875rem;
- line-height: 1.25;
}
h3{
font-size: 1.5rem;
- line-height: 1.35;
}
h4{
font-size: 1.3125rem; /* 21/16 */
- line-height: 1.35;
}
p{
- font-size: 1.0625rem;
+ font-size: 1rem;
@include breakpoint("mobile"){
font-size: 0.9375rem;
}
-}
\ No newline at end of file
+}
diff --git a/app/server/views/styles/components/written_content.scss b/app/server/views/styles/components/written_content.scss
index 193cf0c..aa4a666 100644
--- a/app/server/views/styles/components/written_content.scss
+++ b/app/server/views/styles/components/written_content.scss
@@ -4,10 +4,9 @@
*
*/
- @use '../01-settings/colors';
- @use '../01-settings/fonts';
- @use '../06-tools/functions' as f;
- @use '../06-tools/mixins';
+ @import '../abstracts/colors';
+ @import '../abstracts/fonts';
+
.written-content {
@@ -24,29 +23,26 @@
h1,
h2 {
- font-size: f.px2rem(32px);
+ font-size: 32px;
- @include mixins.mobile {
- font-size: f.px2rem(28px);
- }
}
h3 {
- font-size: f.px2rem(24px);
+ font-size: 24px;
}
h4 {
- font-size: f.px2rem(20px);
+ font-size: 20px;
}
h5,
h6 {
- font-size: f.px2rem(16px);
+ font-size: 16px;
}
p, ul, ol, .note {
- font-family: fonts.$system;
- font-size: f.px2rem(16px);
+ font-family: $base;
+ font-size: 16px;
line-height: 1.66;
word-break: break-word;
}
@@ -56,7 +52,7 @@
}
a {
- color: colors.$orange-determination;
+ color: $orange-determination;
}
em {
@@ -65,10 +61,10 @@
}
code {
- background-color: rgba(colors.$grey-thought, 0.25);
- border: 1px solid colors.$grey-thought;
+ background-color: rgba($grey-thought, 0.25);
+ border: 1px solid $grey-thought;
padding: 1px 8px;
- font-size: f.px2rem(15px);
+ font-size: 15px;
border-radius: 8px;
}
@@ -88,8 +84,8 @@
blockquote {
margin-top: 24px;
padding: 24px;
- border: 1px solid colors.$orange-glow;
- background-color: colors.$white;
+ border: 1px solid $orange-glow;
+ background-color: $white;
border-radius: 16px;
}
@@ -105,7 +101,7 @@
&::before {
content: "\200B";
- background-color: colors.$orange-enthusiasm;
+ background-color: $orange-enthusiasm;
display: inline-block;
height: 8px;
width: 8px;
@@ -140,7 +136,7 @@
}
img.bordered {
- border: 1px solid colors.$black-night;
+ border: 1px solid $black-night;
}
}
From 23c060e498ae1eee65c8544b5fee22b85fbb9cdb Mon Sep 17 00:00:00 2001
From: edith <58082567+jellodiil@users.noreply.github.com>
Date: Mon, 3 Jun 2024 22:58:37 +0800
Subject: [PATCH 04/19] WEB-6747: SVGs to symbols
---
app/server/views/shared/_svg_icons.html.erb | 69 +++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/app/server/views/shared/_svg_icons.html.erb b/app/server/views/shared/_svg_icons.html.erb
index 624cd6e..2558edb 100644
--- a/app/server/views/shared/_svg_icons.html.erb
+++ b/app/server/views/shared/_svg_icons.html.erb
@@ -24,4 +24,73 @@
+
<%= lesson.description %>
<%= segment.description %>
- - <%= segment.ref %> - -