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

Feature/pfe 1828 update radio checkmarks dg #1017

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

PriJoh
Copy link
Collaborator

@PriJoh PriJoh commented Nov 13, 2024

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):

image
image
image
image
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have updated the CHANGELOG document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Review instructions

Review instructions

Copy link

github-actions bot commented Nov 13, 2024

Size Change: +674 B (+0.06%)

Total Size: 1.16 MB

Filename Size Change
dist/designguide/styles/payex.css 52.1 kB +330 B (+0.64%)
dist/styles/payex.css 52.1 kB +330 B (+0.64%)
ℹ️ View Unchanged
Filename Size Change
dist/designguide/scripts/dg-dashboard.js 73.2 kB 0 B
dist/designguide/scripts/dg.js 24.9 kB 0 B
dist/designguide/styles/documentation-payex.css 10.1 kB +7 B (+0.07%)
dist/designguide/styles/documentation-swedbankpay.css 9.19 kB 0 B
dist/designguide/styles/swedbankpay.css 49.1 kB 0 B
dist/scripts/3563.js 72.1 kB 0 B
dist/scripts/dg-dashboard.js 73.2 kB 0 B
dist/scripts/dg.js 24.9 kB 0 B
dist/scripts/payex.js 325 kB 0 B
dist/scripts/swedbankpay.js 325 kB 0 B
dist/styles/documentation-payex.css 10.1 kB +7 B (+0.07%)
dist/styles/documentation-swedbankpay.css 9.19 kB 0 B
dist/styles/swedbankpay.css 49.1 kB 0 B

compressed-size-action

background-image: url("../../../icons/payex/circlepx_disabled.svg");
}

.checkmark {
Copy link
Collaborator

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

Comment on lines 33 to 34
border: 1px solid var(--gray);
outline: none !important;
Copy link
Collaborator

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:

Suggested change
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

}

&:hover {
border: 1px solid var(--gray) !important;
Copy link
Collaborator

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.

Comment on lines +43 to +44
background-color: var(--light-gray) !important;
color: var(--brand-secondary) !important;
Copy link
Collaborator

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

Suggested change
background-color: var(--light-gray) !important;
color: var(--brand-secondary) !important;
background-color: var(--light-gray);
color: var(--brand-secondary);

Comment on lines 14 to 28

&: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");
}
Copy link
Collaborator

@goldenraphti goldenraphti Dec 13, 2024

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

Suggested change
&: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");
}
}
}

@PriJoh PriJoh requested a review from goldenraphti December 13, 2024 13:43
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.

2 participants