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

Make use of currentColor #62

Merged
merged 10 commits into from
Oct 5, 2020
Merged

Make use of currentColor #62

merged 10 commits into from
Oct 5, 2020

Conversation

camillef
Copy link

@camillef camillef commented Sep 23, 2020

To allow customer branding to cascade

Also includes some miscellaneous fixes picked up from reviewing the update with customer branding in Shipshape

@@ -3,10 +3,10 @@
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons

@mixin button-variant-plain($color, $background, $border) {
Copy link
Author

Choose a reason for hiding this comment

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

The $border seemed to always be the same as $color so I've removed and used currentColor for all instances of both $color and $border except for the base rule color: $color; which will get overridden by customer branding if needed

@danielmatthew
Copy link

Looking good: changed the green to rebeccapurple and button borders followed suit…

Screenshot 2020-09-24 at 08 58 38

…but: what about that pesky btn-primary state, and inputs, with a color of #ffffff and #000000 respectively 🤔

@danielmatthew
Copy link

danielmatthew commented Sep 24, 2020

Do you think there's anything we can do with https://github.com/talis/rl-app/blob/master/src/classes/api/BrandingAPI.class.php to dump out the two core customer colours in the following format?

Your instances of currentColor can be swapped for the appropriate variable.

<style>
:root {
  --customerPrimary: #101;
  --customSecondary: #999;
}
</style>

@camillef
Copy link
Author

Do you think there's anything we can do with https://github.com/talis/rl-app/blob/master/src/classes/api/BrandingAPI.class.php to dump out the two core customer colours in the following format?

<style>
:root {
  --customerPrimary: #101;
  --customSecondary: #999;
}
</style>

I don't see why not! Might we also need the navbar colour? I'm not sure what the plan is for focus on that...

@danielmatthew
Copy link

I don't see why not! Might we also need the navbar colour? I'm not sure what the plan is for focus on that...

Ah, blummin' heck. Yes, that would be another property we'd need. Focus/active state-wise, the outline should be left at our be our default white state for now.

@camillef
Copy link
Author

Ah, blummin' heck. Yes, that would be another property we'd need. Focus/active state-wise, the outline should be left at our be our default white state for now.

Raised a PR: https://github.com/talis/rl-app/pull/2808

@@ -96,8 +96,8 @@ a.btn {

// Make a button look and behave like a link
.btn-link {
font-weight: 400;
Copy link
Author

Choose a reason for hiding this comment

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

Redefined two lines below

color: $link-color;
border-color: transparent;
Copy link
Author

Choose a reason for hiding this comment

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

Ensure btn-link always has a transparent border, even if it is also a btn-danger

Examples are

  • the cancel button on the action bar when item has been cut
    image
  • the set importance button when no importance has been set
    image

Comment on lines +18 to +23
.btn-alert {
text-decoration: none;
&:hover {
color: $white !important;
}
}
Copy link
Author

Choose a reason for hiding this comment

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

Overwrite the two rules immediately above when we have an a styled as a button inside an alert using btn-alert

Should look like
image
and on hover
image

@@ -199,6 +199,10 @@
background-image: none;
}

&:hover:active {
background-color: $black;
Copy link
Author

Choose a reason for hiding this comment

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

Should favour hover background-color when both hover and active

Choose a reason for hiding this comment

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

Was it going transparent again when clicked?

Copy link
Author

Choose a reason for hiding this comment

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

Yep
Oct-05-2020 11-23-41

@camillef camillef marked this pull request as ready for review October 2, 2020 16:17
@camillef camillef added the 90% label Oct 2, 2020
@camillef
Copy link
Author

camillef commented Oct 2, 2020

Your instances of currentColor can be swapped for the appropriate variable.

Having experimented with CSS variables a little, they really don't play nicely with SCSS... as soon as you want to pass the variable to a function, the sass compiler errors with messages along the lines of argument $color of darken($color, $amount) must be a color

@danielmatthew
Copy link

Having experimented with CSS variables a little, they really don't play nicely with SCSS...

That's OK. A custom property could be modified with a built-in CSS function instead. We'd modify the l of a hsla() colour to darken it by the required amount.

dist/app.css Outdated
@@ -226,7 +226,7 @@ a {
text-decoration: none; }

Choose a reason for hiding this comment

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

Don't worry about commiting changes in app.css: there's a task to generate the dist files when the version is bumped.

Choose a reason for hiding this comment

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

Oh yeah… the release process. I've been using conventional-commits to help with this. Would you agree that this commit is probably of 'fix', so will bump the patch version?

Copy link
Author

Choose a reason for hiding this comment

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

Yep, agree

Copy link

@danielmatthew danielmatthew left a comment

Choose a reason for hiding this comment

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

Happy with how it's rendering on http://localhost:8000/ ?

@danielmatthew danielmatthew merged commit 40cb629 into master Oct 5, 2020
@danielmatthew danielmatthew deleted the use-currentColor branch October 5, 2020 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants