Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-factor and streamline the SCSS basics. #351

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

rasben
Copy link
Contributor

@rasben rasben commented Nov 27, 2023

Re-factor and streamline the SCSS basics.

This is a major overhaul and refactoring of all the basics.
It moves shared items out of the individual stories, and into
mixins, variables and other base files.
One of the major things is that it streamlines typography:
It introduces a variables.typography.scss file, that defines all
the typographies, and a @include typography($VARIABLE) to use them.
This way, we can keep track of typographies, and have a single place
to look when we make new modules.

This way, we also have an easy way of quality-secure against figma.
All of this is the first step. There is still a lot of stuff that
needs to be fixed.

To begin with, I've made sure that all existing classes still work.
E.g. '.text-h1' will still compile to the same, but in SCSS we cant
use %text-h1 anymore.
A future step is to look through all the stuff I've marked as
'legacy', and tweak/remove/edit the classes throughout dpl-cms, react
and other places.


I've added documentation here - please start by reading that :)

https://github.com/danskernesdigitalebibliotek/dpl-design-system/blob/31fce6cfb1ea1ac682ca51e97118ebc60ce125e1/docs/scss.md

@rasben rasben force-pushed the refactor-everything branch 11 times, most recently from cd51404 to d10e235 Compare November 29, 2023 15:21
@kasperg kasperg changed the base branch from release/2023-49-0 to release/2023-51-0 December 5, 2023 12:42
@rasben rasben force-pushed the refactor-everything branch 10 times, most recently from f8006e6 to 1e6f1b5 Compare December 5, 2023 23:10
@rasben rasben changed the title wip Re-factor and streamline the SCSS basics. Dec 5, 2023
@rasben rasben force-pushed the refactor-everything branch 3 times, most recently from 9b54538 to 31fce6c Compare December 6, 2023 10:41
@rasben rasben marked this pull request as ready for review December 6, 2023 11:06
@spaceo spaceo self-assigned this Dec 6, 2023
Copy link
Contributor

@kasperg kasperg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of stuff going on here. It can be hard to tell search/replace from meaningful comments.

I have some comments here and there about all sorts of stuff.

  • There are some changes regarding name changes and the move to mixins where I personally do not understand the value.
  • I like that you improve the documentation about our guidelines here.
  • Your thoughts about when to use sizing variables or literal values needs to be elaborated. I could not infer your intention from the actual changes.

base.scss Outdated Show resolved Hide resolved
docs/scss.md Outdated Show resolved Hide resolved
docs/scss.md Outdated Show resolved Hide resolved
src/stories/Blocks/advanced-search/advanced-search.scss Outdated Show resolved Hide resolved
docs/scss.md Outdated Show resolved Hide resolved
src/styles/scss/tools/mixins.scss Outdated Show resolved Hide resolved
src/styles/scss/tools/mixins.scss Outdated Show resolved Hide resolved
src/styles/scss/tools/mixins.scss Outdated Show resolved Hide resolved
docs/scss.md Outdated Show resolved Hide resolved
docs/scss.md Show resolved Hide resolved
@rasben rasben force-pushed the refactor-everything branch 5 times, most recently from 30055b0 to 6245dd8 Compare December 7, 2023 23:05
@rasben rasben force-pushed the refactor-everything branch from 6245dd8 to d2e999c Compare December 9, 2023 20:54
This is a major overhaul and refactoring of all the basics.
It moves shared items out of the individual stories, and into
mixins, variables and other base files.
One of the major things is that it streamlines typography:
It introduces a variables.typography.scss file, that defines all
the typographies, and a @include typography($VARIABLE) to use them.
This way, we can keep track of typographies, and have a single place
to look when we make new modules.

This way, we also have an easy way of quality-secure against figma.
All of this is the first step. There is still a lot of stuff that
needs to be fixed.

To begin with, I've made sure that all existing classes still work.
E.g. '.text-h1' will still compile to the same, but in SCSS we cant
use %text-h1 anymore.
A future step is to look through all the stuff I've marked as
'legacy', and tweak/remove/edit the classes throughout dpl-cms, react
and other places.
@rasben rasben force-pushed the refactor-everything branch from d2e999c to 01351af Compare December 9, 2023 21:06
run: yarn css:prettier -- --check

js_prettier:
markdown-linkt:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo...

Copy link
Contributor

@spaceo spaceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Nice work!
A bit of a rubber stamp approval from my side I must admit.
I need to get my fingers dirty in order to get a feeling of it.
Also with my limited experience of working with styling I need to get my fingers dirty to get a feeling of it, rather than looking at page after page with changes 😄

Copy link
Contributor

@kasperbirch1 kasperbirch1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the others saying ok

@rasben rasben merged commit 5fdbb88 into release/2023-51-0 Dec 11, 2023
9 checks passed
@rasben rasben deleted the refactor-everything branch December 11, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants