-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature/pfe 1828 update radio checkmarks dg #1017
base: develop
Are you sure you want to change the base?
Conversation
Size Change: +674 B (+0.06%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
src/less/components/payex/radio.less
Outdated
background-image: url("../../../icons/payex/circlepx_disabled.svg"); | ||
} | ||
|
||
.checkmark { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try adding .radio
to the selector, this way you're adding teh same specificity than in the "base" css file for radio component, and therefore it might likely decrease a lot the need for using !important
in your declarations
So either by adding the .radio
selector before .checkmark
( = .radio.checkmark ) OR by nesting the .checkmark { ... }
rule inside the over-arching .radio { ... }
parent
src/less/components/payex/radio.less
Outdated
border: 1px solid var(--gray); | ||
outline: none !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removing outline to replace it by borders ?
If the change is motivated by another reason than the change of color please let meknow, I'm very open to revisit how we style this component, especially if it's because you've spotted some accessibility issues or something like this.
If the change is only to achieve a change of color then I think you can achieve if more easily by only modifying the outline color:
border: 1px solid var(--gray); | |
outline: none !important; | |
outline-color: var(--gray); |
this goes for teh rest of the file, everywhere outline
is changed for border
src/less/components/payex/radio.less
Outdated
} | ||
|
||
&:hover { | ||
border: 1px solid var(--gray) !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if only the color is modified on hover, then use a *-color
property
e.g.
border-color: var(--gray);
OR if you've switched back to outline:
outline-color: var(--gray);
BUT beyond that:
do we need this declaration?
the [outline/border]-color value is already declared asvar(--gray)
, so I do not see the reason why adding it.
background-color: var(--light-gray) !important; | ||
color: var(--brand-secondary) !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!important
is not needed if you add .radio
to the .checkmark
selector
background-color: var(--light-gray) !important; | |
color: var(--brand-secondary) !important; | |
background-color: var(--light-gray); | |
color: var(--brand-secondary); |
src/less/components/payex/radio.less
Outdated
|
||
&:is(:hover, :focus-visible) + label:before { | ||
box-shadow: 0 0 0 0.375rem var(--gray); | ||
} | ||
|
||
&:checked + label:before { | ||
background-position: center; | ||
background-image: url("../../../icons/payex/circlepx.svg"); | ||
} | ||
} | ||
} | ||
|
||
.radio input[type=radio][disabled]:checked+label:before { | ||
background-image: url("../../../icons/payex/circlepx_disabled.svg"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can nest it inside the previous rule
&:is(:hover, :focus-visible) + label:before { | |
box-shadow: 0 0 0 0.375rem var(--gray); | |
} | |
&:checked + label:before { | |
background-position: center; | |
background-image: url("../../../icons/payex/circlepx.svg"); | |
} | |
} | |
} | |
.radio input[type=radio][disabled]:checked+label:before { | |
background-image: url("../../../icons/payex/circlepx_disabled.svg"); | |
} | |
&:is(:hover, :focus-visible) + label:before { | |
box-shadow: 0 0 0 0.375rem var(--gray); | |
} | |
&:checked + label:before { | |
background-position: center; | |
background-image: url("../../../icons/payex/circlepx.svg"); | |
} | |
&[disabled]:checked+label:before { | |
background-image: url("../../../icons/payex/circlepx_disabled.svg"); | |
} | |
} | |
} |
Description
I have fixed the radio button so it now have a black circle SVG and I also corrected the hover color.
I have also adjusted the checkmarks to have the correct color, background color, and hover state in default, hover, and disabled modes.
I had to use !important on most of the styles because otherwise, it would inherit everything from Swedbank Pay across multiple levels if I didn't use it.
( I'm not sure why I can't see the correct font-family in my branch but in the develop branch it's correct, so I hope it will be correct when the updates gets in there)
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Review instructions
Review instructions