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

40 Implemented dynamic global css variables #89

Merged
merged 17 commits into from
Nov 9, 2023

Conversation

BaBrixx
Copy link
Contributor

@BaBrixx BaBrixx commented Oct 26, 2023

I made a huge mistake and merge comitted the branch linked to issue #50 into my original CSS branch. This included every individual commits from the other branch into my CSS branch. I tried to revert it but failed and was therefore forced to use this solution.

Link to original PR

Closes #40

About

This pull request contains the initial implementation of the dynamic loading of CSS colors (And other CSS properties) and is the foundation for one of the features requested by the PO.

The specific feature is the one in-which users should be able to change the color-scheme by themselves.

Features implemented:

  • Zod schemes representing the structure of the different media queries and their associated css properties, defined in the GlobalCSSProperties.JSON file .
  • Media Queries Loader that loads the correct CSS properties from the JSON file based on which media queries matches the browsers. This includes eventlisteners so that the colorscheme automatically changes (ex. changing from light to dark mode).
  • Dark and light mode CSS properties for the existing GUI elements in the main branch
  • Minor changes to the console implementation that removes the need for a hard coded estimated height of the console bar. The reason for this is that the estimated height was wrong in macOS.

Not yet implemented

  • The styling of the right side panel has not been finalised as work is still being done on that component.
  • Fonts should eventually also be dynamically implemented. An issue should probably be created about this.

Link to MDN docs for mediaQuery selector

I made a huge mistake and merge comitted the branch linked to issue #50 into my original CSS branch. This included every individual commits from the other branch into my CSS branch. I tried to revert it but failed and was therefore forced to use this solution.
@BaBrixx BaBrixx linked an issue Oct 26, 2023 that may be closed by this pull request
@netlify
Copy link

netlify bot commented Oct 26, 2023

Deploy Preview for ecdar ready!

Name Link
🔨 Latest commit 5aa51b9
🔍 Latest deploy log https://app.netlify.com/sites/ecdar/deploys/654b9bba7422180008ea530b
😎 Deploy Preview https://deploy-preview-89--ecdar.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@BaBrixx BaBrixx marked this pull request as ready for review October 26, 2023 11:55
@BaBrixx BaBrixx self-assigned this Oct 26, 2023
@BaBrixx BaBrixx marked this pull request as draft October 27, 2023 11:22
BaBrixx and others added 4 commits November 2, 2023 12:00
This makes sure that no unsupported CSS variables are used. The supported CSS variables are specified  in CSSVariables.ts
@BaBrixx BaBrixx marked this pull request as ready for review November 2, 2023 11:22
Copy link
Collaborator

@atjn atjn left a comment

Choose a reason for hiding this comment

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

Looks very nice! I have a few comments and suggestions.

src/lib/classes/styling/GlobalCssSchemesLoader.ts Outdated Show resolved Hide resolved
src/lib/classes/styling/GlobalCssSchemesLoader.ts Outdated Show resolved Hide resolved
src/lib/classes/styling/GlobalCssSchemesLoader.ts Outdated Show resolved Hide resolved
src/lib/classes/styling/GlobalCssSchemesLoader.ts Outdated Show resolved Hide resolved
BaBrixx and others added 4 commits November 2, 2023 14:08
The zos schemes now enforce:
- The color value range
- That the "default" mediascheme contains a specification of all specified CSS variables

and more...
@BaBrixx BaBrixx requested a review from atjn November 3, 2023 09:13
atjn
atjn previously approved these changes Nov 3, 2023
Copy link
Collaborator

@atjn atjn left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@DenFlyvendeGed DenFlyvendeGed left a comment

Choose a reason for hiding this comment

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

lille fix, men ellers ser det godt ud :)

src/lib/components/query/Query.svelte Outdated Show resolved Hide resolved
DenFlyvendeGed
DenFlyvendeGed previously approved these changes Nov 8, 2023
Copy link
Contributor

@DenFlyvendeGed DenFlyvendeGed left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@atjn atjn left a comment

Choose a reason for hiding this comment

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

LVGTMTYVMSW

Copy link
Contributor

@DenFlyvendeGed DenFlyvendeGed left a comment

Choose a reason for hiding this comment

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

LGTM

@BaBrixx BaBrixx merged commit 1373078 into main Nov 9, 2023
6 checks passed
@BaBrixx BaBrixx deleted the 40-use-css-variables-for-general-design-secondtry branch November 9, 2023 08:52
TSKsmiley pushed a commit that referenced this pull request Nov 9, 2023
* Implemented everything

I made a huge mistake and merge comitted the branch linked to issue #50 into my original CSS branch. This included every individual commits from the other branch into my CSS branch. I tried to revert it but failed and was therefore forced to use this solution.

* Added dark mode color to edges

* Created a CSS variable support check

This makes sure that no unsupported CSS variables are used. The supported CSS variables are specified  in CSSVariables.ts

* Changed resizer size

* Removed unnecessary media schemes

* Removed mediaFeature check

* Corrrect the parsed error type

* Removed the passing of the global window variable

* Removed the need for range checking by using zod

* Improved the zod schemes

The zod schemes now enforce:
- The color value range
- That the "default" mediascheme contains a specification of all specified CSS variables

and more...

* Fix typo

* Did some color styling to the navbar
NybyDK added a commit that referenced this pull request Nov 10, 2023
* Add systems and components

* Maybe this way to rename?

* Moved handler so can click if there is no text

For example if user names it whitespace it can be hard to rename

* Sveltify and add description

* Color options

Systems and Components files are almost identical

* Type

* Merge components and systems into 1 file

* Drop down menu for project items

* Delete ComponentDropDownMenu.svelte

* Update ProjectItemDropDownMenu.svelte

* Fix periodic check binding in ProjectItems and add
dynamic class to ProjectItem

* 40 Implemented dynamic global css variables (#89)

* Implemented everything

I made a huge mistake and merge comitted the branch linked to issue #50 into my original CSS branch. This included every individual commits from the other branch into my CSS branch. I tried to revert it but failed and was therefore forced to use this solution.

* Added dark mode color to edges

* Created a CSS variable support check

This makes sure that no unsupported CSS variables are used. The supported CSS variables are specified  in CSSVariables.ts

* Changed resizer size

* Removed unnecessary media schemes

* Removed mediaFeature check

* Corrrect the parsed error type

* Removed the passing of the global window variable

* Removed the need for range checking by using zod

* Improved the zod schemes

The zod schemes now enforce:
- The color value range
- That the "default" mediascheme contains a specification of all specified CSS variables

and more...

* Fix typo

* Did some color styling to the navbar

* Add IDs to add component and add system buttons in
ProjectNav component

* css variables

* Update project item and dropdown menu components
Co-authored-by: Nyby <[email protected]>

* Remove unused imports and clean up code.

* Fix tests and add new ones

Co-authored-by: Nyby <[email protected]>

* lint

---------

Co-authored-by: Skrome <[email protected]>
Co-authored-by: Nyby <[email protected]>
Co-authored-by: Bastian Brix <[email protected]>
Co-authored-by: Nyby <[email protected]>
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.

Use CSS variables for general design
3 participants