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

Add configurable borders #20226

Merged
merged 32 commits into from
Oct 31, 2023
Merged

Add configurable borders #20226

merged 32 commits into from
Oct 31, 2023

Conversation

rijkvanzanten
Copy link
Member

Scope

What's changed:

  • Added border-radius rules
  • Added border-color rules
  • Added optional borders for the module bar
  • Added box-shadow rules

Potential Risks / Drawbacks

  • Similar as the rest of the theming project. There's a chance some elements aren't using the proper variables which can cause some minor styling glitches.

Review Notes / Questions

  • Be careful: It's very addicting once you start playing around with making themes!

Fixes #20139

@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2023

🦋 Changeset detected

Latest commit: e06cd81

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@directus/themes Minor
docs Minor
@directus/app Minor
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rijkvanzanten
Copy link
Member Author

Some "beauty" shots from earlier experiments:

image
image

image

image

image

CleanShot_2023-10-27_at_18.31.17.mp4

Copy link
Contributor

@azrikahar azrikahar left a comment

Choose a reason for hiding this comment

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

Seems like --v-divider-color is updated to use input border color here:

--v-divider-color: var(--theme--form--field--input--border-color);

which made the dividers in navigation bar "blends" into the background and may be perceived as transparent:

Not saying this is an issue though since it can be tweaked easily.

Though with that context, it seems like certain dividers such as ones in User navigation:

.v-divider {
--v-divider-color: var(--background-normal-alt);
}

overrides it with other value. I assume we should remove this style for consistency?

There are a two other instances that I'm not sure should we remove them, so I'm listing them here to make it easier for you to verify:

--v-divider-color: var(--background-normal);

--v-divider-color: var(--background-normal-alt);

app/src/styles/themes/_dark.scss Outdated Show resolved Hide resolved
app/src/styles/themes/_light.scss Outdated Show resolved Hide resolved
@@ -143,7 +143,7 @@ body {
width: 100%;
background-color: transparent;
border: none;
border-bottom: 2px solid var(--border-normal);
border-bottom: 2px solid var(--theme--form--field--input--border-color);
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we use the var here as well?

Suggested change
border-bottom: 2px solid var(--theme--form--field--input--border-color);
border-bottom: var(--theme--border-width) solid var(--theme--form--field--input--border-color);

Copy link
Member

@paescuj paescuj left a comment

Choose a reason for hiding this comment

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

Approved*! Great work 🤩

* provided that I cannot be held responsible for the addictive nature of this feature

@rijkvanzanten rijkvanzanten merged commit 474f8ea into main Oct 31, 2023
6 checks passed
@rijkvanzanten rijkvanzanten deleted the themes/20139 branch October 31, 2023 18:36
@github-actions github-actions bot added this to the Next Patch Release milestone Oct 31, 2023
br-rafaelbarros pushed a commit to personal-forks/directus-source that referenced this pull request Nov 7, 2023
* Add borderRadius rule

* Standardize border radii

There was a border-outline style that was visually nearly identical that was hardly ever used. The places it was used in felt like more of an oversight / inconsistent usage than intentional, so I've opted to standardize it to the same configured radius

* Replace --border-radius with --theme--border-radius

* Remove border radius from variables.scss

* Remove default

* Allow overriding v-input border-radius

* Update legacy overrides

* Default to 6px

* Remove overrides

* Update overrides to use v-input specific

* Add LineWidth, fix schema output

* Use border-width from theme

* Add border colors for inputs

* Use theme form colors for borders

* Configurable box-shadow for input

* Use configurable shadow

* Add optional module bar border

* Reduce white space

* Add optional border to nav bar

* Add configurable sidebar border

* Add configurable header shadow

* Add changeset

* Run formatter

* fix borderWidth for calc

* Remove border-normal

* Use border-width for 2px values where appropriate

* Use theme border for avatar divider

* Add rules for project info border

* Add border support to project info

* Add border support for section toggle

* Run formatter

---------

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Primary color is missing in the login form Add rules for borders
3 participants