From daa97738965a167031a36a133001b1259875aa65 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 7 Dec 2024 10:48:32 +0100 Subject: [PATCH 01/18] Convert sass variables in to css variables. --- .../funds/includes/review_sidebar_item.html | 2 +- hypha/static_src/sass/abstracts/_mixins.scss | 79 ++---------- .../static_src/sass/abstracts/_variables.scss | 116 +++++++++++++----- hypha/static_src/sass/base/_base.scss | 4 +- hypha/static_src/sass/base/_typography.scss | 39 +----- .../sass/components/_actions-bar.scss | 2 +- .../components/_activity-notifications.scss | 2 +- .../sass/components/_admin-bar.scss | 4 +- .../sass/components/_all-reviews-table.scss | 2 +- .../components/_all-submissions-table.scss | 10 +- hypha/static_src/sass/components/_button.scss | 18 +-- .../sass/components/_cookieconsent.scss | 4 +- .../sass/components/_data-block.scss | 14 +-- .../sass/components/_docs-block.scss | 4 +- hypha/static_src/sass/components/_feed.scss | 8 +- .../static_src/sass/components/_filters.scss | 4 +- hypha/static_src/sass/components/_form.scss | 14 +-- .../static_src/sass/components/_heading.scss | 4 +- .../sass/components/_invoice-block.scss | 2 +- .../sass/components/_list-reveal.scss | 4 +- hypha/static_src/sass/components/_list.scss | 4 +- .../static_src/sass/components/_messages.scss | 6 +- hypha/static_src/sass/components/_modal.scss | 4 +- hypha/static_src/sass/components/_nav.scss | 2 +- .../sass/components/_projects-table.scss | 2 +- .../sass/components/_reviews-list.scss | 2 +- .../sass/components/_reviews-sidebar.scss | 8 +- .../sass/components/_round-block.scss | 6 +- .../static_src/sass/components/_select2.scss | 8 +- .../static_src/sass/components/_sidebar.scss | 2 +- .../sass/components/_stat-block.scss | 2 +- .../sass/components/_status-bar.scss | 6 +- .../sass/components/_submission-meta.scss | 2 +- hypha/static_src/sass/components/_table.scss | 2 +- hypha/static_src/sass/components/_tabs.scss | 4 +- .../static_src/sass/components/_tooltip.scss | 2 +- .../static_src/sass/components/_wrapper.scss | 2 +- 37 files changed, 179 insertions(+), 221 deletions(-) diff --git a/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html b/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html index b029b08728..8d3fa7c570 100644 --- a/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html +++ b/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html @@ -32,7 +32,7 @@ {% if reviewer.role %}{% image reviewer.role.icon max-12x12 %}{% endif %} -
{{ reviewer.review.created_at|date:"SHORT_DATE_FORMAT" }}
+
{{ reviewer.review.created_at|date:"SHORT_DATE_FORMAT" }}
{% else %}
diff --git a/hypha/static_src/sass/abstracts/_mixins.scss b/hypha/static_src/sass/abstracts/_mixins.scss index 26374f09f9..13acd5b61b 100644 --- a/hypha/static_src/sass/abstracts/_mixins.scss +++ b/hypha/static_src/sass/abstracts/_mixins.scss @@ -23,78 +23,15 @@ } } -// Placeholder text -@mixin placeholder-text { - &.placeholder { - @content; - } - &:-moz-placeholder { - @content; - } - &::-moz-placeholder { - @content; - } - &:-ms-input-placeholder { - @content; - } - &::-webkit-input-placeholder { - @content; - } -} - -// Hide text -@mixin hidden { - position: absolute; - clip: rect(0 0 0 0); - clip-path: inset(50%); - height: 1px; - width: 1px; - overflow: hidden; - white-space: nowrap; -} - -// Output a rem value for the given property -@mixin rem($property, $values) { - $rem: (); - - @each $value in $values { - @if $value == 0 or $value == auto or $value == inherit { - $rem: list.append($rem, $value); - } @else { - $rem: list.append( - $rem, - functions.rem(functions.strip-unit($value)) - ); - } - } - #{$property}: $rem; -} - -// Output a `font-size: [x]rem;` declaration for the given px value -@mixin rem-font-size($font-size) { - @include rem(font-size, $font-size); -} - -// Font sizes -@mixin font-size($keyword) { - $size: map.get(variables.$font-sizes, $keyword); - - @if $size == null { - @warn 'Font size '#{$keyword}' does not exist'; - } @else { - @include rem-font-size($size); - } -} - // Button mixin @mixin button($bg, $hover-bg) { padding: 0.5em 2rem; - font-weight: variables.$weight--bold; - color: variables.$color--white; + font-weight: var(--weight-bold); + color: var(--color-white); text-align: center; background: $bg; - border: 1px solid variables.$color--white; - transition: color, background, border, variables.$transition; + border: 1px solid var(--color-white); + transition: color, background, border, var(--transition); display: flex; align-items: center; justify-content: center; @@ -159,7 +96,7 @@ // @param {Direction} $direction - Triangle direction, either `top`, `right`, `bottom` or `left` // @param {Color} $color [currentcolor] - Triangle color // @param {Length} $size [1em] - Triangle size -@mixin triangle($direction, $color: currentcolor, $size: 1em) { +@mixin triangle($direction, $color: currentcolor, $size: 0.33rem) { @if not list.index(top right bottom left, $direction) { @error 'Direction must be either `top`, `right`, `bottom` or `left`.'; } @@ -188,7 +125,7 @@ &.desc, &.asc { position: relative; - color: variables.$color--dark-grey; + color: var(--color-dark-grey); &::after { position: absolute; @@ -203,13 +140,13 @@ &.desc { &::after { - @include triangle(top, variables.$color--default, 5px); + @include triangle(top); } } &.asc { &::after { - @include triangle(bottom, variables.$color--default, 5px); + @include triangle(bottom); } } } diff --git a/hypha/static_src/sass/abstracts/_variables.scss b/hypha/static_src/sass/abstracts/_variables.scss index 538da7727f..636a4f6d84 100644 --- a/hypha/static_src/sass/abstracts/_variables.scss +++ b/hypha/static_src/sass/abstracts/_variables.scss @@ -1,8 +1,92 @@ @use "sass:color"; // stylelint-disable color-function-notation, color-no-hex, alpha-value-notation, value-keyword-case -// Set via JS :root { - --last-listing-item-height: 0; + // Default + --color-white: #fff; + --color-black: #1f2328; + --color-light-grey: #f7f7f7; + --color-light-mid-grey: #e8e8e8; + --color-mid-grey: #cfcfcf; + --color-mid-dark-grey: #919191; + --color-dark-grey: #404041; + + // Brand + --color-lightest-blue: #24aae1; + --color-light-blue: #1d79a8; + --color-light-blue-90: rgba(29, 121, 168, 0.1); + --color-lighter-blue: #7ab8d4; + --color-dark-blue: #0c72a0; + --color-darkest-blue: #3d6bdb; + --color-mustard: #e6ab32; + --color-purple: #8c0bbf; + --color-pink: #d02a85; + --color-light-pink: #ffe1df; + --color-light-green: #e1fae1; + --color-cream: #f5f7e7; + --color-tomato: #f05e54; + --color-mint: #40c2ad; + --color-grass: #7dc588; + --color-ocean: #1888b1; + --color-sky-blue: #e7f2f6; + --color-marine: #14729a; + --color-mist: #f3fafe; + --color-green: #7dc558; + --color-pastel-red: #f1a9a9; + --color-pastel-green: #afe6af; + --color-fog: #eff2f5; + + // Transparent + --color-black-60: rgba(0, 0, 0, 0.6); + --color-black-50: rgba(0, 0, 0, 0.5); + --color-black-40: rgba(0, 0, 0, 0.4); + --color-black-25: rgba(0, 0, 0, 0.25); + --color-black-20: rgba(0, 0, 0, 0.2); + --color-black-10: rgba(0, 0, 0, 0.1); + --color-white-50: rgba(255, 255, 255, 0.5); + --color-white-40: rgba(255, 255, 255, 0.4); + --color-white-25: rgba(255, 255, 255, 0.25); + --color-white-20: rgba(255, 255, 255, 0.2); + --color-white-10: rgba(255, 255, 255, 0.1); + + // Assignment + --color-default: var(--color-black); + --color-primary: var(--color-light-blue); + --color-error: var(--color-tomato); + --color-correct: var(--color-mint); + --color-button-disabled: var(--color-lighter-blue); + + // Font weights + --weight-black: 800; + --weight-bold: 700; + --weight-semibold: 600; + --weight-normal: 400; + --weight-light: 200; + + // Font sizes + --base-font-size: 16px; + --base-font-size-large: 18px; + --base-line-height: 24px; + --base-line-height-large: 28px; + + // Wrappers + --site-width: 1280px; + --wrapper-medium: 1020px; + --wrapper-small: 790px; + + // Text line length + --max-text-line-length: 50em; + + // Transition + --transition: 0.25s ease-out; + --quick-transition: 0.15s ease; + + // Spacing + --mobile-gutter: 1.25rem; + --gutters: calc(5px + 1.5625vw); + --gutters-reverse: calc(0px - (5px + 1.5625vw)); + + // Dropdown height + --dropdown-height: 45px; } // Default @@ -64,19 +148,6 @@ $color--error: $color--tomato; $color--correct: $color--mint; $color--button-disabled: $color--lighter-blue; -// Fonts -$font--primary: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", - Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; -$font--headings: $font--primary; - -// Font weights -$weight--black: 800; -$weight--bold: 700; -$weight--semibold: 600; -$weight--normal: 400; -$weight--light: 200; - // Font sizes $base-font-size: 16px; $base-font-size-large: 18px; @@ -93,7 +164,6 @@ $font-sizes: ( ); // Wrappers -$site-width: 1280px; $wrapper--medium: 1020px; $wrapper--small: 790px; @@ -115,23 +185,9 @@ $breakpoints: ( // Transition $transition: 0.25s ease-out; $quick-transition: 0.15s ease; -$medium-transition: 0.5s ease; - -// Delays -$base-delay: 30ms; // Spacing $mobile-gutter: 1.25rem; // Filters $filter-dropdown: ".select2 .select2-selection.select2-selection--single"; - -// Dropdown height -$dropdown-height: 45px; - -// Border radius -$rounded-sm: 0.125rem; -$rounded: 0.25rem; -$rounded-md: 0.375rem; -$rounded-lg: 0.5rem; -$rounded-full: 9999px; diff --git a/hypha/static_src/sass/base/_base.scss b/hypha/static_src/sass/base/_base.scss index 28547c7b0a..428b141c2d 100644 --- a/hypha/static_src/sass/base/_base.scss +++ b/hypha/static_src/sass/base/_base.scss @@ -37,14 +37,14 @@ details > summary { %is-invisible { z-index: -1; opacity: 0; - transition: opacity, z-index, variables.$transition; + transition: opacity, z-index, var(--transition); } .is-visible, %is-visible { z-index: 5; opacity: 1; - transition: opacity, z-index, variables.$transition; + transition: opacity, z-index, var(--transition); } .is-hidden, diff --git a/hypha/static_src/sass/base/_typography.scss b/hypha/static_src/sass/base/_typography.scss index 862864e7d6..925938b7c4 100644 --- a/hypha/static_src/sass/base/_typography.scss +++ b/hypha/static_src/sass/base/_typography.scss @@ -1,30 +1,4 @@ -@use "../abstracts/mixins"; -@use "../abstracts/variables"; -@use "sass:math"; - // $TYPOGRAPHY -// Base font -html { - color: variables.$color--default; -} - -/* ============================================ - Families – one mixin per typeface - :: For each font mixin defined here, make sure each property is negated (set - :: to its default value, usually `inherit`) in all other font mixins. -*/ -@mixin heading-text { - margin: 0 0 1rem; - font-style: inherit; - font-weight: variables.$weight--semibold; -} - -@mixin body-text { - font-family: variables.$font--primary; - font-style: inherit; - font-weight: inherit; - text-transform: inherit; -} h1, h2, @@ -33,14 +7,9 @@ h4, h5, h6, .heading-text { - @include heading-text; -} - -.body-text { - @include mixins.responsive-font-sizes( - variables.$base-font-size, - variables.$base-font-size-large - ); + margin-block: 0 1rem; + font-style: inherit; + font-weight: var(--weight-semibold); } // Default sizes @@ -85,7 +54,7 @@ h5, h6, %h6, .zeta { - @include mixins.font-size(zeta); + font-size: 1rem; } small, diff --git a/hypha/static_src/sass/components/_actions-bar.scss b/hypha/static_src/sass/components/_actions-bar.scss index 098bb7425a..cca8b354a3 100644 --- a/hypha/static_src/sass/components/_actions-bar.scss +++ b/hypha/static_src/sass/components/_actions-bar.scss @@ -61,6 +61,6 @@ border-radius: 30px; min-width: 120px; text-align: center; - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); } } diff --git a/hypha/static_src/sass/components/_activity-notifications.scss b/hypha/static_src/sass/components/_activity-notifications.scss index baf6ea061f..ec94fb239e 100644 --- a/hypha/static_src/sass/components/_activity-notifications.scss +++ b/hypha/static_src/sass/components/_activity-notifications.scss @@ -19,7 +19,7 @@ justify-content: space-between; label { - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); padding-inline-end: 1em; } diff --git a/hypha/static_src/sass/components/_admin-bar.scss b/hypha/static_src/sass/components/_admin-bar.scss index c62d970299..ab4eda02a2 100644 --- a/hypha/static_src/sass/components/_admin-bar.scss +++ b/hypha/static_src/sass/components/_admin-bar.scss @@ -14,7 +14,7 @@ } &__inner { - max-width: variables.$site-width; + max-width: var(--site-width); margin: 0 auto; &--with-button { @@ -43,7 +43,7 @@ display: inline-flex; align-items: center; color: variables.$color--lightest-blue; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); &::before { @include mixins.triangle(top, currentColor, 5px); diff --git a/hypha/static_src/sass/components/_all-reviews-table.scss b/hypha/static_src/sass/components/_all-reviews-table.scss index 98088050b2..12d216acc2 100644 --- a/hypha/static_src/sass/components/_all-reviews-table.scss +++ b/hypha/static_src/sass/components/_all-reviews-table.scss @@ -29,7 +29,7 @@ position: relative; padding-block-start: 15px; padding-inline-start: 10px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); @include mixins.media-query(lg) { display: flex; diff --git a/hypha/static_src/sass/components/_all-submissions-table.scss b/hypha/static_src/sass/components/_all-submissions-table.scss index 457fb9b161..29e717bafc 100644 --- a/hypha/static_src/sass/components/_all-submissions-table.scss +++ b/hypha/static_src/sass/components/_all-submissions-table.scss @@ -84,7 +84,7 @@ &.title { position: relative; padding-block-start: 15px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); @include mixins.media-query(lg) { display: flex; @@ -102,7 +102,7 @@ display: inline-block; padding: 5px; font-size: 13px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); color: variables.$color--marine; text-align: center; background-color: variables.$color--sky-blue; @@ -170,7 +170,7 @@ position: relative; display: inline-block; transform: rotate(0); - transition: transform variables.$transition; + transition: transform var(--transition); &:hover { cursor: pointer; @@ -237,7 +237,7 @@ p { margin: 0; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); color: variables.$color--default; } @@ -278,7 +278,7 @@ a { margin: 0; flex-basis: auto; - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); } } } diff --git a/hypha/static_src/sass/components/_button.scss b/hypha/static_src/sass/components/_button.scss index 7515097022..574ad0d5ac 100644 --- a/hypha/static_src/sass/components/_button.scss +++ b/hypha/static_src/sass/components/_button.scss @@ -9,7 +9,7 @@ background-image: none; border: 0; box-shadow: none; - border-radius: variables.$rounded-sm; + border-radius: 0.125rem; &:hover { cursor: pointer; @@ -154,7 +154,7 @@ justify-content: space-between; max-width: 300px; padding: 15px 20px; - font-weight: variables.$weight--normal; + font-weight: var(--weight-normal); color: variables.$color--default; border: 1px solid variables.$color--light-mid-grey; transition: none; @@ -267,7 +267,7 @@ padding: 3px; margin-block-start: 10px; font-size: 12px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); text-align: center; text-transform: uppercase; border: 1px solid currentcolor; @@ -301,8 +301,8 @@ display: flex; color: variables.$color--default; align-items: center; - transition: opacity variables.$transition; - font-weight: variables.$weight--semibold; + transition: opacity var(--transition); + font-weight: var(--weight-semibold); position: relative; &:hover { @@ -322,11 +322,11 @@ width: 200px; padding: 12px; font-size: 12px; - font-weight: variables.$weight--normal; + font-weight: var(--weight-normal); white-space: normal; background: variables.$color--light-blue; opacity: 0; - transition: opacity variables.$transition; + transition: opacity var(--transition); inset-block-end: 45px; inset-inline-start: 50%; transform: translateX(-50%); @@ -334,7 +334,7 @@ text-align: left; line-height: 1rem; border: 1px solid variables.$color--white; - border-radius: variables.$rounded-sm; + border-radius: 0.125rem; } &::after { @@ -348,7 +348,7 @@ inset-inline-start: 50%; transform: translateX(-50%); opacity: 0; - transition: opacity variables.$transition; + transition: opacity var(--transition); z-index: 10; } diff --git a/hypha/static_src/sass/components/_cookieconsent.scss b/hypha/static_src/sass/components/_cookieconsent.scss index ed309dd173..e5fcb9a94d 100644 --- a/hypha/static_src/sass/components/_cookieconsent.scss +++ b/hypha/static_src/sass/components/_cookieconsent.scss @@ -8,7 +8,7 @@ background-color: variables.$color--dark-blue; border-block-start: 4px solid variables.$color--light-blue; transform: translateY(100vh); - transition: all variables.$transition; + transition: all var(--transition); overflow: hidden; max-height: 37.5rem; @@ -24,7 +24,7 @@ &__content { width: 200%; margin-left: 0; - transition: all variables.$transition; + transition: all var(--transition); } &__content > div { diff --git a/hypha/static_src/sass/components/_data-block.scss b/hypha/static_src/sass/components/_data-block.scss index d79ca2fb57..5834c5d169 100644 --- a/hypha/static_src/sass/components/_data-block.scss +++ b/hypha/static_src/sass/components/_data-block.scss @@ -29,7 +29,7 @@ &__title { font-size: variables.$base-font-size-large; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); margin: 0 0 1rem; @include mixins.media-query(sm) { @@ -66,7 +66,7 @@ @include mixins.media-query(lg) { display: block; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } } @@ -77,12 +77,12 @@ &__pagination-link, &__rejected-link { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } &__mobile-label { display: inline-block; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); white-space: pre; @include mixins.media-query(lg) { @@ -153,7 +153,7 @@ &__action-link { font-size: map.get(variables.$font-sizes, zeta); - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); display: inline-block; margin-inline-end: 1rem; text-decoration: underline; @@ -173,7 +173,7 @@ &__action-icon-link { font-size: map.get(variables.$font-sizes, zeta); - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); display: flex; align-items: center; margin-inline-end: 1rem; @@ -264,6 +264,6 @@ } &__card-title { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } } diff --git a/hypha/static_src/sass/components/_docs-block.scss b/hypha/static_src/sass/components/_docs-block.scss index 11921de999..295d55e97e 100644 --- a/hypha/static_src/sass/components/_docs-block.scss +++ b/hypha/static_src/sass/components/_docs-block.scss @@ -83,7 +83,7 @@ } &__link { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); margin-inline-end: 1rem; &:disabled, @@ -98,7 +98,7 @@ } &__icon-link { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); display: flex; align-items: center; margin-inline-end: 1rem; diff --git a/hypha/static_src/sass/components/_feed.scss b/hypha/static_src/sass/components/_feed.scss index 24081b8808..42aae53afc 100644 --- a/hypha/static_src/sass/components/_feed.scss +++ b/hypha/static_src/sass/components/_feed.scss @@ -94,7 +94,7 @@ margin: 0 10px 0 0; span { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } @include mixins.media-query(sm) { @@ -110,7 +110,7 @@ color: variables.$color--mid-dark-grey; span { - font-weight: variables.$weight--normal; + font-weight: var(--weight-normal); } } @@ -118,7 +118,7 @@ margin-inline-start: auto; span { - font-weight: variables.$weight--normal; + font-weight: var(--weight-normal); } } @@ -179,7 +179,7 @@ &__heading-status { padding: 3px 10px; font-size: map.get(variables.$font-sizes, milli); - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); color: variables.$color--marine; text-align: center; text-transform: uppercase; diff --git a/hypha/static_src/sass/components/_filters.scss b/hypha/static_src/sass/components/_filters.scss index cf18a5d53f..6c27290ec3 100644 --- a/hypha/static_src/sass/components/_filters.scss +++ b/hypha/static_src/sass/components/_filters.scss @@ -20,8 +20,8 @@ @include mixins.media-query(lg) { display: block; max-height: 0; - transition: max-height variables.$medium-transition; - transition-delay: variables.$base-delay; + transition: max-height var(--transition); + transition-delay: 30ms; pointer-events: none; &.filters-open { diff --git a/hypha/static_src/sass/components/_form.scss b/hypha/static_src/sass/components/_form.scss index b8a8160d4e..ee23cd77ea 100644 --- a/hypha/static_src/sass/components/_form.scss +++ b/hypha/static_src/sass/components/_form.scss @@ -17,7 +17,7 @@ label { display: block; margin-block-end: 0.5em; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } } @@ -100,7 +100,7 @@ &__question { display: block; - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); font-size: 1rem; line-height: 1.25rem; @@ -154,7 +154,7 @@ color: variables.$color--mid-grey; padding: 25px; font-size: 17px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); text-align: center; border: 2px dashed variables.$color--mid-grey; border-radius: 5px; @@ -166,7 +166,7 @@ border-block-start: 1px solid variables.$color--mid-grey; &.is-active { - font-weight: variables.$weight--normal; + font-weight: var(--weight-normal); background-color: color.adjust( variables.$color--primary, $alpha: -0.9 @@ -184,11 +184,11 @@ align-items: flex-start; padding: 10px 0 30px; opacity: 0; - transition: opacity variables.$transition; + transition: opacity var(--transition); .filters-open & { opacity: 1; - transition-delay: variables.$base-delay * 10; + transition-delay: 300ms; } .filters--dates & { @@ -343,7 +343,7 @@ max-width: 100%; select { - height: variables.$dropdown-height; + height: var(--dropdown-height); } } } diff --git a/hypha/static_src/sass/components/_heading.scss b/hypha/static_src/sass/components/_heading.scss index de65f853d8..a528aea86c 100644 --- a/hypha/static_src/sass/components/_heading.scss +++ b/hypha/static_src/sass/components/_heading.scss @@ -31,7 +31,7 @@ display: flex; flex-direction: column; margin-block-start: 20px; - font-weight: variables.$weight--normal; + font-weight: var(--weight-normal); color: color.adjust(variables.$color--dark-grey, $alpha: -0.5); @include mixins.media-query(lg) { @@ -64,7 +64,7 @@ } &--bold { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } &--activity-feed { diff --git a/hypha/static_src/sass/components/_invoice-block.scss b/hypha/static_src/sass/components/_invoice-block.scss index 881dc60a96..6c6848fee1 100644 --- a/hypha/static_src/sass/components/_invoice-block.scss +++ b/hypha/static_src/sass/components/_invoice-block.scss @@ -25,7 +25,7 @@ } &__title { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); margin: 0 0 0.2rem; } diff --git a/hypha/static_src/sass/components/_list-reveal.scss b/hypha/static_src/sass/components/_list-reveal.scss index 4679499530..de67b6de5c 100644 --- a/hypha/static_src/sass/components/_list-reveal.scss +++ b/hypha/static_src/sass/components/_list-reveal.scss @@ -24,7 +24,7 @@ &--meta { color: variables.$color--dark-blue; - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); display: flex; justify-content: space-between; margin: 0 -24px; @@ -43,7 +43,7 @@ padding: 0; border-block-end: 2px solid variables.$color--light-mid-grey; box-shadow: inset 0 -10px 20px -10px variables.$color--mid-grey; - transition: max-height variables.$transition; + transition: max-height var(--transition); &--determination { border-inline-start: 1px solid variables.$color--light-mid-grey; diff --git a/hypha/static_src/sass/components/_list.scss b/hypha/static_src/sass/components/_list.scss index 7ec40c4b8b..e9d7746bdb 100644 --- a/hypha/static_src/sass/components/_list.scss +++ b/hypha/static_src/sass/components/_list.scss @@ -52,7 +52,7 @@ &--reviewer-name { max-width: 190px; overflow: hidden; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); text-overflow: ellipsis; display: flex; align-items: center; @@ -75,7 +75,7 @@ } #{$root}__item--opinion & { - font-weight: variables.$weight--normal; + font-weight: var(--weight-normal); } } diff --git a/hypha/static_src/sass/components/_messages.scss b/hypha/static_src/sass/components/_messages.scss index 13f9971217..4c1a0d58f3 100644 --- a/hypha/static_src/sass/components/_messages.scss +++ b/hypha/static_src/sass/components/_messages.scss @@ -27,7 +27,7 @@ color: variables.$color--white; font-size: 14px; opacity: 1; - transition: opacity, max-height, variables.$transition; + transition: opacity, max-height, var(--transition); pointer-events: all; max-height: 1000px; background: variables.$color--dark-blue; @@ -54,7 +54,7 @@ &__inner { display: flex; align-items: center; - max-width: variables.$site-width; + max-width: var(--site-width); margin: 0 auto; } @@ -70,7 +70,7 @@ color: variables.$color--dark-blue; background-color: variables.$color--white; display: inline-block; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); padding: 2px 20px; } } diff --git a/hypha/static_src/sass/components/_modal.scss b/hypha/static_src/sass/components/_modal.scss index 55d70fe91b..b8ffc27110 100644 --- a/hypha/static_src/sass/components/_modal.scss +++ b/hypha/static_src/sass/components/_modal.scss @@ -44,7 +44,7 @@ padding: 0; border-block-end: 2px solid variables.$color--light-mid-grey; box-shadow: inset 0 -10px 20px -10px variables.$color--mid-grey; - transition: max-height variables.$transition; + transition: max-height var(--transition); &.is-closed { max-height: 0; @@ -62,7 +62,7 @@ &--meta { color: variables.$color--dark-blue; - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); display: flex; justify-content: space-between; margin: 0 -24px; diff --git a/hypha/static_src/sass/components/_nav.scss b/hypha/static_src/sass/components/_nav.scss index 8dfe8070fa..d3a85e6f7c 100644 --- a/hypha/static_src/sass/components/_nav.scss +++ b/hypha/static_src/sass/components/_nav.scss @@ -11,7 +11,7 @@ position: relative; padding-block: 0.5rem; color: variables.$color--default; - transition: color variables.$transition; + transition: color var(--transition); &:focus, &:hover { diff --git a/hypha/static_src/sass/components/_projects-table.scss b/hypha/static_src/sass/components/_projects-table.scss index 160a6c5c8b..fcf4480fd8 100644 --- a/hypha/static_src/sass/components/_projects-table.scss +++ b/hypha/static_src/sass/components/_projects-table.scss @@ -96,7 +96,7 @@ display: inline-block; padding: 5px; font-size: 13px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); color: variables.$color--white; text-align: center; background-color: variables.$color--dark-blue; diff --git a/hypha/static_src/sass/components/_reviews-list.scss b/hypha/static_src/sass/components/_reviews-list.scss index a36006a6c3..20a7ab4c19 100644 --- a/hypha/static_src/sass/components/_reviews-list.scss +++ b/hypha/static_src/sass/components/_reviews-list.scss @@ -15,7 +15,7 @@ } &:first-child { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } } diff --git a/hypha/static_src/sass/components/_reviews-sidebar.scss b/hypha/static_src/sass/components/_reviews-sidebar.scss index fa4b30391e..28f235cff2 100644 --- a/hypha/static_src/sass/components/_reviews-sidebar.scss +++ b/hypha/static_src/sass/components/_reviews-sidebar.scss @@ -6,7 +6,7 @@ .reviews-sidebar { $root: &; margin-block-end: 20px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); &__decision { position: relative; @@ -30,7 +30,7 @@ &--decision { margin-block-end: 10px; - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); &:first-child { #{$root}__outcome { @@ -82,10 +82,6 @@ } } - &__date { - @include mixins.font-size(milli); - } - &__no-reviews { color: variables.$color--mid-grey; } diff --git a/hypha/static_src/sass/components/_round-block.scss b/hypha/static_src/sass/components/_round-block.scss index ef6d95d1e9..e9f0cfd87b 100644 --- a/hypha/static_src/sass/components/_round-block.scss +++ b/hypha/static_src/sass/components/_round-block.scss @@ -50,7 +50,7 @@ a { margin: 0; flex-basis: auto; - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); } } } @@ -58,7 +58,7 @@ &__view { margin: 0 0 0 auto; transition: color variables.$quick-transition; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); text-transform: uppercase; @include mixins.media-query(lg) { @@ -77,7 +77,7 @@ &__title { color: variables.$color--default; font-size: map.get(variables.$font-sizes, epsilon); - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); } &__not-found { diff --git a/hypha/static_src/sass/components/_select2.scss b/hypha/static_src/sass/components/_select2.scss index 4d121f27b7..c1278fceb1 100644 --- a/hypha/static_src/sass/components/_select2.scss +++ b/hypha/static_src/sass/components/_select2.scss @@ -15,12 +15,12 @@ width: 100% !important; .select2-selection--single { - height: variables.$dropdown-height; + height: var(--dropdown-height); border: 1px solid variables.$color--mid-grey; border-radius: 0; &.is-active { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); border-color: variables.$color--primary; } @@ -31,12 +31,12 @@ .select2-selection__rendered { padding-inline-start: 15px; padding-inline-end: 30px; - line-height: variables.$dropdown-height; + line-height: var(--dropdown-height); } .select2-selection__arrow { inset-inline-end: 15px; - height: variables.$dropdown-height; + height: var(--dropdown-height); pointer-events: none; background: url("./../images/dropdown.svg") transparent no-repeat 95% center; diff --git a/hypha/static_src/sass/components/_sidebar.scss b/hypha/static_src/sass/components/_sidebar.scss index 15eb00f1ca..b3b180b44d 100644 --- a/hypha/static_src/sass/components/_sidebar.scss +++ b/hypha/static_src/sass/components/_sidebar.scss @@ -55,7 +55,7 @@ &__separator { position: relative; font-size: 12px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); color: variables.$color--black-40; text-transform: uppercase; diff --git a/hypha/static_src/sass/components/_stat-block.scss b/hypha/static_src/sass/components/_stat-block.scss index d9577d1d05..b6ffa0d258 100644 --- a/hypha/static_src/sass/components/_stat-block.scss +++ b/hypha/static_src/sass/components/_stat-block.scss @@ -52,7 +52,7 @@ &__view { text-transform: uppercase; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); transition: opacity variables.$quick-transition; @include mixins.media-query(md) { diff --git a/hypha/static_src/sass/components/_status-bar.scss b/hypha/static_src/sass/components/_status-bar.scss index 00f5873e2e..6441bc62b9 100644 --- a/hypha/static_src/sass/components/_status-bar.scss +++ b/hypha/static_src/sass/components/_status-bar.scss @@ -42,7 +42,7 @@ &__text { font-size: map.get(variables.$font-sizes, milli); - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); } &__item { @@ -89,7 +89,7 @@ &::before { font-size: map.get(variables.$font-sizes, milli); - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); color: variables.$color--white; background: variables.$color--primary; border-color: variables.$color--primary; @@ -139,7 +139,7 @@ color: variables.$color--white; background-color: variables.$color--tomato; padding-inline: var(--tooltip-padding); - border-radius: variables.$rounded-sm; + border-radius: 0.125rem; } &::before { diff --git a/hypha/static_src/sass/components/_submission-meta.scss b/hypha/static_src/sass/components/_submission-meta.scss index 5b7f2fdd65..2e5fccc25f 100644 --- a/hypha/static_src/sass/components/_submission-meta.scss +++ b/hypha/static_src/sass/components/_submission-meta.scss @@ -11,7 +11,7 @@ display: inline-block; padding: 10px; font-size: 13px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); color: variables.$color--mid-dark-grey; text-align: center; background-color: transparent; diff --git a/hypha/static_src/sass/components/_table.scss b/hypha/static_src/sass/components/_table.scss index 9ada233f5b..b39d1b7531 100644 --- a/hypha/static_src/sass/components/_table.scss +++ b/hypha/static_src/sass/components/_table.scss @@ -103,7 +103,7 @@ &.title { a { - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); text-decoration: underline; } } diff --git a/hypha/static_src/sass/components/_tabs.scss b/hypha/static_src/sass/components/_tabs.scss index d756ca9739..ec8cb6d917 100644 --- a/hypha/static_src/sass/components/_tabs.scss +++ b/hypha/static_src/sass/components/_tabs.scss @@ -24,7 +24,7 @@ position: relative; padding: 10px; - font-weight: variables.$weight--bold; + font-weight: var(--weight-bold); hyphens: auto; color: variables.$color--mid-grey; text-transform: uppercase; @@ -55,7 +55,7 @@ &--alt { font-size: map.get(variables.$font-sizes, zeta); - font-weight: variables.$weight--semibold; + font-weight: var(--weight-semibold); padding: 0.5rem 1rem; text-transform: none; display: inline-block; diff --git a/hypha/static_src/sass/components/_tooltip.scss b/hypha/static_src/sass/components/_tooltip.scss index 2377d763ba..0015e72abc 100644 --- a/hypha/static_src/sass/components/_tooltip.scss +++ b/hypha/static_src/sass/components/_tooltip.scss @@ -13,7 +13,7 @@ visibility: hidden; opacity: 0; pointer-events: none; - transition: opacity, bottom, variables.$transition; + transition: opacity, bottom, var(--transition); position: absolute; inset-block-end: 110%; margin-block-end: 5px; diff --git a/hypha/static_src/sass/components/_wrapper.scss b/hypha/static_src/sass/components/_wrapper.scss index 3260a6e8e9..362d00f3f2 100644 --- a/hypha/static_src/sass/components/_wrapper.scss +++ b/hypha/static_src/sass/components/_wrapper.scss @@ -17,7 +17,7 @@ } &--large { - max-width: variables.$site-width; + max-width: var(--site-width); margin-inline-start: auto; margin-inline-end: auto; } From 1afcc4fe95c16ad1e366e189893a73bdbcda03a9 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 7 Dec 2024 15:15:44 +0100 Subject: [PATCH 02/18] Convert sass variable quick-transition in to css variables. --- hypha/static_src/sass/abstracts/_variables.scss | 4 ---- hypha/static_src/sass/components/_actions-bar.scss | 2 +- hypha/static_src/sass/components/_button.scss | 2 +- hypha/static_src/sass/components/_list-reveal.scss | 2 +- hypha/static_src/sass/components/_modal.scss | 2 +- hypha/static_src/sass/components/_round-block.scss | 4 ++-- hypha/static_src/sass/components/_stat-block.scss | 2 +- hypha/static_src/sass/components/_status-block.scss | 2 +- 8 files changed, 8 insertions(+), 12 deletions(-) diff --git a/hypha/static_src/sass/abstracts/_variables.scss b/hypha/static_src/sass/abstracts/_variables.scss index 636a4f6d84..6f0bac10ca 100644 --- a/hypha/static_src/sass/abstracts/_variables.scss +++ b/hypha/static_src/sass/abstracts/_variables.scss @@ -182,10 +182,6 @@ $breakpoints: ( "2xl" "(min-width: 1536px)" ); -// Transition -$transition: 0.25s ease-out; -$quick-transition: 0.15s ease; - // Spacing $mobile-gutter: 1.25rem; diff --git a/hypha/static_src/sass/components/_actions-bar.scss b/hypha/static_src/sass/components/_actions-bar.scss index cca8b354a3..bb14c42b6d 100644 --- a/hypha/static_src/sass/components/_actions-bar.scss +++ b/hypha/static_src/sass/components/_actions-bar.scss @@ -44,7 +44,7 @@ display: flex; opacity: 0; pointer-events: none; - transition: opacity variables.$quick-transition; + transition: opacity var(--quick-transition); .batch-actions-enabled & { opacity: 1; diff --git a/hypha/static_src/sass/components/_button.scss b/hypha/static_src/sass/components/_button.scss index 574ad0d5ac..13d1870ee8 100644 --- a/hypha/static_src/sass/components/_button.scss +++ b/hypha/static_src/sass/components/_button.scss @@ -271,7 +271,7 @@ text-align: center; text-transform: uppercase; border: 1px solid currentcolor; - transition: background-color, color, border, variables.$quick-transition; + transition: background-color, color, border, var(--quick-transition); @include mixins.media-query(md) { margin-block-start: 0; diff --git a/hypha/static_src/sass/components/_list-reveal.scss b/hypha/static_src/sass/components/_list-reveal.scss index de67b6de5c..ca04ce00a3 100644 --- a/hypha/static_src/sass/components/_list-reveal.scss +++ b/hypha/static_src/sass/components/_list-reveal.scss @@ -66,7 +66,7 @@ height: 20px; fill: variables.$color--dark-grey; opacity: 0; - transition: opacity variables.$quick-transition; + transition: opacity var(--quick-transition); pointer-events: none; #{$root}__item:hover & { diff --git a/hypha/static_src/sass/components/_modal.scss b/hypha/static_src/sass/components/_modal.scss index b8ffc27110..fa01123c83 100644 --- a/hypha/static_src/sass/components/_modal.scss +++ b/hypha/static_src/sass/components/_modal.scss @@ -78,7 +78,7 @@ height: 20px; fill: variables.$color--dark-grey; opacity: 0; - transition: opacity variables.$quick-transition; + transition: opacity var(--quick-transition); pointer-events: none; #{$root}__list-item:hover & { diff --git a/hypha/static_src/sass/components/_round-block.scss b/hypha/static_src/sass/components/_round-block.scss index e9f0cfd87b..78b9686214 100644 --- a/hypha/static_src/sass/components/_round-block.scss +++ b/hypha/static_src/sass/components/_round-block.scss @@ -15,7 +15,7 @@ border: 1px solid variables.$color--light-mid-grey; border-block-end: 0; padding: 25px; - transition: background-color variables.$quick-transition; + transition: background-color var(--quick-transition); min-height: 80px; &:last-child { @@ -57,7 +57,7 @@ &__view { margin: 0 0 0 auto; - transition: color variables.$quick-transition; + transition: color var(--quick-transition); font-weight: var(--weight-bold); text-transform: uppercase; diff --git a/hypha/static_src/sass/components/_stat-block.scss b/hypha/static_src/sass/components/_stat-block.scss index b6ffa0d258..cac11d8de3 100644 --- a/hypha/static_src/sass/components/_stat-block.scss +++ b/hypha/static_src/sass/components/_stat-block.scss @@ -53,7 +53,7 @@ &__view { text-transform: uppercase; font-weight: var(--weight-bold); - transition: opacity variables.$quick-transition; + transition: opacity var(--quick-transition); @include mixins.media-query(md) { position: absolute; diff --git a/hypha/static_src/sass/components/_status-block.scss b/hypha/static_src/sass/components/_status-block.scss index 456edef7c5..f97df3312a 100644 --- a/hypha/static_src/sass/components/_status-block.scss +++ b/hypha/static_src/sass/components/_status-block.scss @@ -15,7 +15,7 @@ padding: 10px 20px; border-block-end: 1px solid variables.$color--light-mid-grey; background-color: variables.$color--white; - transition: background-color variables.$quick-transition; + transition: background-color var(--quick-transition); @include mixins.media-query(lg) { border-block-end: 0; From 5c86d7be268b6c616681fc1e6524049934073f6e Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 7 Dec 2024 15:27:08 +0100 Subject: [PATCH 03/18] Remove need for base-font-* and base-line-*. --- hypha/static_src/sass/abstracts/_variables.scss | 16 ---------------- .../static_src/sass/components/_data-block.scss | 2 +- hypha/static_src/sass/components/_feed.scss | 2 +- hypha/static_src/sass/components/_form.scss | 4 ---- hypha/static_src/sass/components/_rich-text.scss | 2 +- hypha/static_src/sass/components/_wrapper.scss | 4 ++-- 6 files changed, 5 insertions(+), 25 deletions(-) diff --git a/hypha/static_src/sass/abstracts/_variables.scss b/hypha/static_src/sass/abstracts/_variables.scss index 6f0bac10ca..57333f78ad 100644 --- a/hypha/static_src/sass/abstracts/_variables.scss +++ b/hypha/static_src/sass/abstracts/_variables.scss @@ -62,12 +62,6 @@ --weight-normal: 400; --weight-light: 200; - // Font sizes - --base-font-size: 16px; - --base-font-size-large: 18px; - --base-line-height: 24px; - --base-line-height-large: 28px; - // Wrappers --site-width: 1280px; --wrapper-medium: 1020px; @@ -150,9 +144,6 @@ $color--button-disabled: $color--lighter-blue; // Font sizes $base-font-size: 16px; -$base-font-size-large: 18px; -$base-line-height: 24px; -$base-line-height-large: 28px; $font-sizes: ( alpha: 36px, beta: 30px, @@ -163,13 +154,6 @@ $font-sizes: ( milli: 12px, ); -// Wrappers -$wrapper--medium: 1020px; -$wrapper--small: 790px; - -// Text line length -$max-text-line-length: 50em; - // The custom width of 465px allow the buttons to scale with the input field $input-box-max-width: 465px; diff --git a/hypha/static_src/sass/components/_data-block.scss b/hypha/static_src/sass/components/_data-block.scss index 5834c5d169..693393e381 100644 --- a/hypha/static_src/sass/components/_data-block.scss +++ b/hypha/static_src/sass/components/_data-block.scss @@ -28,7 +28,7 @@ } &__title { - font-size: variables.$base-font-size-large; + font-size: map.get(variables.$font-sizes, epsilon); font-weight: var(--weight-bold); margin: 0 0 1rem; diff --git a/hypha/static_src/sass/components/_feed.scss b/hypha/static_src/sass/components/_feed.scss index 42aae53afc..3f3b368df1 100644 --- a/hypha/static_src/sass/components/_feed.scss +++ b/hypha/static_src/sass/components/_feed.scss @@ -152,7 +152,7 @@ &__comment { word-break: break-word; - max-width: variables.$max-text-line-length; + max-width: var(--max-text-line-length); } &__related-item { diff --git a/hypha/static_src/sass/components/_form.scss b/hypha/static_src/sass/components/_form.scss index ee23cd77ea..7e24edc4de 100644 --- a/hypha/static_src/sass/components/_form.scss +++ b/hypha/static_src/sass/components/_form.scss @@ -447,10 +447,6 @@ width: 100%; padding: 0.4em; border: 1px solid variables.$color--mid-grey; - line-height: math.div( - variables.$base-line-height, - variables.$base-font-size - ); } .wmd-preview { diff --git a/hypha/static_src/sass/components/_rich-text.scss b/hypha/static_src/sass/components/_rich-text.scss index c86e491923..354b89a6ee 100644 --- a/hypha/static_src/sass/components/_rich-text.scss +++ b/hypha/static_src/sass/components/_rich-text.scss @@ -3,7 +3,7 @@ .rich-text { margin-block-end: 2rem; word-break: break-word; - max-width: variables.$max-text-line-length; + max-width: var(--max-text-line-length); &--answers { > section { diff --git a/hypha/static_src/sass/components/_wrapper.scss b/hypha/static_src/sass/components/_wrapper.scss index 362d00f3f2..79d81425a7 100644 --- a/hypha/static_src/sass/components/_wrapper.scss +++ b/hypha/static_src/sass/components/_wrapper.scss @@ -5,13 +5,13 @@ width: 100%; &--small { - max-width: variables.$wrapper--small; + max-width: var(--wrapper-small); margin-inline-start: auto; margin-inline-end: auto; } &--medium { - max-width: variables.$wrapper--medium; + max-width: var(--wrapper-medium); margin-inline-start: auto; margin-inline-end: auto; } From b7fda1f918af5526b17247909f96e58d8741d998 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 7 Dec 2024 15:29:20 +0100 Subject: [PATCH 04/18] Remove unused colours. --- hypha/static_src/sass/abstracts/_variables.scss | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hypha/static_src/sass/abstracts/_variables.scss b/hypha/static_src/sass/abstracts/_variables.scss index 57333f78ad..5c31940ae7 100644 --- a/hypha/static_src/sass/abstracts/_variables.scss +++ b/hypha/static_src/sass/abstracts/_variables.scss @@ -33,7 +33,6 @@ --color-green: #7dc558; --color-pastel-red: #f1a9a9; --color-pastel-green: #afe6af; - --color-fog: #eff2f5; // Transparent --color-black-60: rgba(0, 0, 0, 0.6); @@ -115,12 +114,6 @@ $color--mist: #f3fafe; $color--green: #7dc558; $color--pastel-red: #f1a9a9; $color--pastel-green: #afe6af; -$color--fog: #eff2f5; - -// Social -$color--twitter: #1da6f6; -$color--linkedin: #137ab8; -$color--facebook: #396ab5; // Transparent $color--black-60: rgba(0, 0, 0, 0.6); From fd9db79a307d826fffed169f1eea21d568ca3c72 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 7 Dec 2024 15:41:37 +0100 Subject: [PATCH 05/18] Redo gutters and font-size. --- hypha/static_src/sass/abstracts/_mixins.scss | 1 - .../static_src/sass/abstracts/_variables.scss | 22 ++++++++----------- .../sass/components/_admin-bar.scss | 4 ++-- hypha/static_src/sass/components/_button.scss | 5 ++--- .../sass/components/_data-block.scss | 9 ++++---- hypha/static_src/sass/components/_feed.scss | 5 ++--- .../sass/components/_list-reveal.scss | 7 +++--- hypha/static_src/sass/components/_modal.scss | 3 +-- .../sass/components/_round-block.scss | 3 +-- .../sass/components/_status-bar.scss | 5 ++--- hypha/static_src/sass/components/_tabs.scss | 3 +-- .../static_src/sass/components/_wrapper.scss | 2 +- hypha/static_src/sass/layout/_header.scss | 6 ++--- 13 files changed, 31 insertions(+), 44 deletions(-) diff --git a/hypha/static_src/sass/abstracts/_mixins.scss b/hypha/static_src/sass/abstracts/_mixins.scss index 13acd5b61b..e2ae446475 100644 --- a/hypha/static_src/sass/abstracts/_mixins.scss +++ b/hypha/static_src/sass/abstracts/_mixins.scss @@ -1,5 +1,4 @@ @use "sass:list"; -@use "sass:map"; @use "functions"; @use "variables"; diff --git a/hypha/static_src/sass/abstracts/_variables.scss b/hypha/static_src/sass/abstracts/_variables.scss index 5c31940ae7..9372514c14 100644 --- a/hypha/static_src/sass/abstracts/_variables.scss +++ b/hypha/static_src/sass/abstracts/_variables.scss @@ -54,6 +54,15 @@ --color-correct: var(--color-mint); --color-button-disabled: var(--color-lighter-blue); + // Font sizes + --font-size-alpha: 36px; + --font-size-beta: 30px; + --font-size-gamma: 28px; + --font-size-delta: 24px; + --font-size-epsilon: 18px; + --font-size-zeta: 14px; + --font-size-milli: 12px; + // Font weights --weight-black: 800; --weight-bold: 700; @@ -74,7 +83,6 @@ --quick-transition: 0.15s ease; // Spacing - --mobile-gutter: 1.25rem; --gutters: calc(5px + 1.5625vw); --gutters-reverse: calc(0px - (5px + 1.5625vw)); @@ -137,15 +145,6 @@ $color--button-disabled: $color--lighter-blue; // Font sizes $base-font-size: 16px; -$font-sizes: ( - alpha: 36px, - beta: 30px, - gamma: 28px, - delta: 24px, - epsilon: 18px, - zeta: 14px, - milli: 12px, -); // The custom width of 465px allow the buttons to scale with the input field $input-box-max-width: 465px; @@ -159,8 +158,5 @@ $breakpoints: ( "2xl" "(min-width: 1536px)" ); -// Spacing -$mobile-gutter: 1.25rem; - // Filters $filter-dropdown: ".select2 .select2-selection.select2-selection--single"; diff --git a/hypha/static_src/sass/components/_admin-bar.scss b/hypha/static_src/sass/components/_admin-bar.scss index ab4eda02a2..145579b872 100644 --- a/hypha/static_src/sass/components/_admin-bar.scss +++ b/hypha/static_src/sass/components/_admin-bar.scss @@ -3,8 +3,8 @@ .admin-bar { position: relative; - padding: variables.$mobile-gutter; - margin-inline: calc(0px - variables.$mobile-gutter); + padding: var(--gutters); + margin-inline: var(--gutters-reverse); color: variables.$color--white; background-color: variables.$color--dark-grey; diff --git a/hypha/static_src/sass/components/_button.scss b/hypha/static_src/sass/components/_button.scss index 13d1870ee8..0cc820679b 100644 --- a/hypha/static_src/sass/components/_button.scss +++ b/hypha/static_src/sass/components/_button.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @@ -411,7 +410,7 @@ position: absolute; inset-block-start: 4px; padding-inline-start: 5px; - font-size: map.get(variables.$font-sizes, delta); + font-size: var(--font-size-delta); line-height: 1; } } @@ -437,7 +436,7 @@ &::after { inset-block-start: 2px; padding-inline-start: 3px; - font-size: map.get(variables.$font-sizes, zeta); + font-size: var(--font-size-zeta); } } } diff --git a/hypha/static_src/sass/components/_data-block.scss b/hypha/static_src/sass/components/_data-block.scss index 693393e381..b5227a9b86 100644 --- a/hypha/static_src/sass/components/_data-block.scss +++ b/hypha/static_src/sass/components/_data-block.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @@ -28,7 +27,7 @@ } &__title { - font-size: map.get(variables.$font-sizes, epsilon); + font-size: var(--font-size-epsilon); font-weight: var(--weight-bold); margin: 0 0 1rem; @@ -114,7 +113,7 @@ } tbody { - font-size: map.get(variables.$font-sizes, zeta); + font-size: var(--font-size-zeta); } tr { @@ -152,7 +151,7 @@ } &__action-link { - font-size: map.get(variables.$font-sizes, zeta); + font-size: var(--font-size-zeta); font-weight: var(--weight-bold); display: inline-block; margin-inline-end: 1rem; @@ -172,7 +171,7 @@ } &__action-icon-link { - font-size: map.get(variables.$font-sizes, zeta); + font-size: var(--font-size-zeta); font-weight: var(--weight-bold); display: flex; align-items: center; diff --git a/hypha/static_src/sass/components/_feed.scss b/hypha/static_src/sass/components/_feed.scss index 3f3b368df1..3a5b193fb0 100644 --- a/hypha/static_src/sass/components/_feed.scss +++ b/hypha/static_src/sass/components/_feed.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @use "../base/typography"; @@ -125,7 +124,7 @@ &--progress { width: 100%; margin: 5px 0 0; - font-size: map.get(variables.$font-sizes, milli); + font-size: var(--font-size-milli); color: variables.$color--black-50; @include mixins.media-query(sm) { @@ -178,7 +177,7 @@ &__heading-status { padding: 3px 10px; - font-size: map.get(variables.$font-sizes, milli); + font-size: var(--font-size-milli); font-weight: var(--weight-bold); color: variables.$color--marine; text-align: center; diff --git a/hypha/static_src/sass/components/_list-reveal.scss b/hypha/static_src/sass/components/_list-reveal.scss index ca04ce00a3..de341ff87f 100644 --- a/hypha/static_src/sass/components/_list-reveal.scss +++ b/hypha/static_src/sass/components/_list-reveal.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @@ -7,7 +6,7 @@ &--determination { background-color: variables.$color--white; - margin-block-end: variables.$mobile-gutter; + margin-block-end: var(--gutters); @include mixins.media-query(md) { max-width: 70%; @@ -16,7 +15,7 @@ &__item { display: block; - font-size: map.get(variables.$font-sizes, zeta); + font-size: var(--font-size-zeta); padding: 0.75em 1em; border-block-end: 2px solid variables.$color--light-mid-grey; margin: 0; @@ -39,7 +38,7 @@ &__list { max-height: 200px; overflow: scroll; - margin: 0 -24px variables.$mobile-gutter; + margin: 0 -24px var(--gutters); padding: 0; border-block-end: 2px solid variables.$color--light-mid-grey; box-shadow: inset 0 -10px 20px -10px variables.$color--mid-grey; diff --git a/hypha/static_src/sass/components/_modal.scss b/hypha/static_src/sass/components/_modal.scss index fa01123c83..97e3aebc28 100644 --- a/hypha/static_src/sass/components/_modal.scss +++ b/hypha/static_src/sass/components/_modal.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @@ -54,7 +53,7 @@ &__list-item { display: block; - font-size: map.get(variables.$font-sizes, zeta); + font-size: var(--font-size-zeta); padding: 12px 28px; border-block-end: 2px solid variables.$color--light-mid-grey; margin: 0; diff --git a/hypha/static_src/sass/components/_round-block.scss b/hypha/static_src/sass/components/_round-block.scss index 78b9686214..1c69a60014 100644 --- a/hypha/static_src/sass/components/_round-block.scss +++ b/hypha/static_src/sass/components/_round-block.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @@ -76,7 +75,7 @@ &__title { color: variables.$color--default; - font-size: map.get(variables.$font-sizes, epsilon); + font-size: var(--font-size-epsilon); font-weight: var(--weight-semibold); } diff --git a/hypha/static_src/sass/components/_status-bar.scss b/hypha/static_src/sass/components/_status-bar.scss index 6441bc62b9..244cb9a9a0 100644 --- a/hypha/static_src/sass/components/_status-bar.scss +++ b/hypha/static_src/sass/components/_status-bar.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @@ -41,7 +40,7 @@ } &__text { - font-size: map.get(variables.$font-sizes, milli); + font-size: var(--font-size-milli); font-weight: var(--weight-bold); } @@ -88,7 +87,7 @@ border-color: variables.$color--primary; &::before { - font-size: map.get(variables.$font-sizes, milli); + font-size: var(--font-size-milli); font-weight: var(--weight-bold); color: variables.$color--white; background: variables.$color--primary; diff --git a/hypha/static_src/sass/components/_tabs.scss b/hypha/static_src/sass/components/_tabs.scss index ec8cb6d917..2930f782f0 100644 --- a/hypha/static_src/sass/components/_tabs.scss +++ b/hypha/static_src/sass/components/_tabs.scss @@ -1,4 +1,3 @@ -@use "sass:map"; @use "../abstracts/mixins"; @use "../abstracts/variables"; @@ -54,7 +53,7 @@ } &--alt { - font-size: map.get(variables.$font-sizes, zeta); + font-size: var(--font-size-zeta); font-weight: var(--weight-semibold); padding: 0.5rem 1rem; text-transform: none; diff --git a/hypha/static_src/sass/components/_wrapper.scss b/hypha/static_src/sass/components/_wrapper.scss index 79d81425a7..73330eec65 100644 --- a/hypha/static_src/sass/components/_wrapper.scss +++ b/hypha/static_src/sass/components/_wrapper.scss @@ -23,7 +23,7 @@ } &--main { - padding: 0 variables.$mobile-gutter; + padding: 0 var(--gutters); min-height: calc(100vh - 260px - 160px); // viewport - (header + footer) @include mixins.media-query(xl) { diff --git a/hypha/static_src/sass/layout/_header.scss b/hypha/static_src/sass/layout/_header.scss index 1a712b9eca..12b15bbc93 100644 --- a/hypha/static_src/sass/layout/_header.scss +++ b/hypha/static_src/sass/layout/_header.scss @@ -2,12 +2,12 @@ @use "../abstracts/variables"; .header { - padding: variables.$mobile-gutter; + padding: var(--gutters); background-color: var(--color-header-bg); border-block-end: 1px solid rgb(136 146 171 / 10%); @include mixins.media-query(md) { - padding: 0 variables.$mobile-gutter; + padding: 0 var(--gutters); } @include mixins.media-query(xl) { @@ -15,7 +15,7 @@ } &--nomenu { - padding-block: variables.$mobile-gutter; + padding-block: var(--gutters); } &__inner { From 0a6917470d353e8e8560a8798078c0595b75dbd8 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 7 Dec 2024 17:42:16 +0100 Subject: [PATCH 06/18] Remove most use of color.adjust(). --- .../application_projects/includes/report_line.html | 2 +- .../application_projects/partials/invoice_status_table.html | 2 +- hypha/static_src/sass/abstracts/_mixins.scss | 6 +++--- hypha/static_src/sass/abstracts/_variables.scss | 4 ++++ .../static_src/sass/components/_all-submissions-table.scss | 5 ----- hypha/static_src/sass/components/_data-block.scss | 4 ---- hypha/static_src/sass/components/_form.scss | 6 +----- hypha/static_src/sass/components/_heading.scss | 5 ++--- hypha/static_src/sass/components/_messages.scss | 5 ++--- hypha/static_src/sass/components/_select2.scss | 6 +----- 10 files changed, 15 insertions(+), 30 deletions(-) diff --git a/hypha/apply/projects/templates/application_projects/includes/report_line.html b/hypha/apply/projects/templates/application_projects/includes/report_line.html index 4429166301..8a63accf33 100644 --- a/hypha/apply/projects/templates/application_projects/includes/report_line.html +++ b/hypha/apply/projects/templates/application_projects/includes/report_line.html @@ -15,7 +15,7 @@