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

Introduce new attention level designs for button and related theming for card #2735

Merged
merged 27 commits into from
Jan 17, 2023

Conversation

RasmusKjeldgaard
Copy link
Collaborator

@RasmusKjeldgaard RasmusKjeldgaard commented Jan 10, 2023

Which issue does this PR close?

This PR closes #2684 closes #2602

What is the new behavior?

As card implements the themeColor directive, card is now also responsible for setting the correct theme CSS custom properties that buttons (form-field and segmented-control too, down the line) implement as background-color and color.

Otherwise the button would not have the correct theme when themeColor was not set on card, as the card would have no .kirby-color-brightness-white class applied in that situation. Thus the button would not be able to adapt correctly in its host-context() css selectors.

See both issues linked above for additional context, especially #2602 for the design context.

All in all, this PR includes:

Does this PR introduce a breaking change?

  • Yes
  • No

Are there any additional context?

Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Reminders

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Determine if your changes are a fix, feature or breaking-change, and add the matching label to your PR. If it is tooling, dependency updates or similar, add ignore-for-release.
  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be merged to develop by Team Kirby.

@RasmusKjeldgaard RasmusKjeldgaard force-pushed the enhancement/2684-set-default-themecolor branch from 3300f2b to 505a42d Compare January 12, 2023 08:05
@github-actions github-actions bot temporarily deployed to pr-2684-set-default-themecolor January 13, 2023 12:17 Inactive
@github-actions github-actions bot temporarily deployed to pr-2684-set-default-themecolor January 16, 2023 09:02 Inactive
@RasmusKjeldgaard RasmusKjeldgaard marked this pull request as ready for review January 16, 2023 09:23
@RasmusKjeldgaard RasmusKjeldgaard force-pushed the enhancement/2684-set-default-themecolor branch from c5b2c6b to 558a347 Compare January 16, 2023 09:23
@github-actions github-actions bot temporarily deployed to pr-2684-set-default-themecolor January 16, 2023 09:28 Inactive
@@ -2,20 +2,69 @@ import { Component, Input } from '@angular/core';

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All the changes in this file are just to have a good showcase for the three different versions of dropdown on each theme. It is not the most beautiful solution, but at least it mirrors 100% how we do it for button.

@use '../utils';

@mixin apply-dark-theme {
--kirby-interactive-background-color: #{utils.get-color('white-overlay')};
Copy link
Collaborator Author

@RasmusKjeldgaard RasmusKjeldgaard Jan 16, 2023

Choose a reason for hiding this comment

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

Can we come up with a better prefix than --kirby-interactive- here?
I want it to signal that this is used for our "interactive" components, like buttons, segmented control, form field etc. So it is mostly form-controls, but not quite isolated to those, as segmented control is not a form-control I guess 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a really good question 🤔 The only suggestion I can come up with is --kirby-interactive-element-background-color or --kirby-interactive-component-background-color. If you hadn't explained the reasoning for the naming, then I think it would have been unclear to me, what it targets 🙂 I know that the naming becomes a bit long, but I'm a firm believer in "clarity over brevity", when it comes to naming variables and functions 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree! I changed it to --kirby-interactive-element-background-color and --kirby-interactive-element-background-color

@@ -184,8 +184,12 @@ describe('AvatarComponent', () => {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change seems unrelated, but the approach chosen here for looping over each color broke when I introduced the overlay variants in libs/core/src/scss/themes/_colors.scss.

Instead it is now aligned with the actual implementation inside the component.

@RasmusKjeldgaard RasmusKjeldgaard changed the title Introduce new att-level 3 button and related theming for card Introduce new attention level designs for button and related theming for card Jan 16, 2023
@RasmusKjeldgaard RasmusKjeldgaard added the feature Add this PR to the changelog as a feature label Jan 16, 2023
@github-actions github-actions bot temporarily deployed to pr-2684-set-default-themecolor January 16, 2023 13:38 Inactive
Copy link
Contributor

@mark-drastrup mark-drastrup left a comment

Choose a reason for hiding this comment

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

Really great work! 😄 And nice updates to the documentation as well! I only have some minor comments.

@use '../utils';

@mixin apply-dark-theme {
--kirby-interactive-background-color: #{utils.get-color('white-overlay')};
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a really good question 🤔 The only suggestion I can come up with is --kirby-interactive-element-background-color or --kirby-interactive-component-background-color. If you hadn't explained the reasoning for the naming, then I think it would have been unclear to me, what it targets 🙂 I know that the naming becomes a bit long, but I'm a firm believer in "clarity over brevity", when it comes to naming variables and functions 😄

@RasmusKjeldgaard RasmusKjeldgaard force-pushed the enhancement/2684-set-default-themecolor branch from d10e080 to 751b767 Compare January 17, 2023 13:51
Co-authored-by: mark-drastrup <mark.drastrup@gmail.com>
@github-actions github-actions bot temporarily deployed to pr-2684-set-default-themecolor January 17, 2023 13:56 Inactive
@github-actions github-actions bot temporarily deployed to pr-2684-set-default-themecolor January 17, 2023 13:57 Inactive
Copy link
Contributor

@mark-drastrup mark-drastrup left a comment

Choose a reason for hiding this comment

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

Beautiful! You're a wizard!

@RasmusKjeldgaard RasmusKjeldgaard merged commit d5a30c3 into develop Jan 17, 2023
@RasmusKjeldgaard RasmusKjeldgaard deleted the enhancement/2684-set-default-themecolor branch January 17, 2023 14:58
SigurdVilstrup pushed a commit that referenced this pull request Mar 28, 2023
…for card (#2735)

Co-authored-by: mark-drastrup <mark.drastrup@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Add this PR to the changelog as a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Always set themeColor default value [Enhancement] Make att. level 3 button opacity-based
2 participants