Skip to content

Commit

Permalink
Update check box styles for ActionList to match the rest of Primer (p…
Browse files Browse the repository at this point in the history
…rimer#3224)

Co-authored-by: camertron <camertron@users.noreply.github.com>
Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 6, 2024
1 parent 1647656 commit 3140ad9
Show file tree
Hide file tree
Showing 85 changed files with 26 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-owls-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Update check box styles for ActionList to match the rest of Primer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 10 additions & 43 deletions app/components/primer/alpha/action_list.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -448,64 +448,31 @@ nav-list {
*/
&[aria-checked='true'],
&[aria-selected='true'] {
/* multiselect checkmark */
& .ActionListItem-multiSelectCheckmark {
visibility: visible;
opacity: 1;
transition:
visibility 0 linear 0,
opacity 50ms;
& .FormControl-checkbox {
background: var(--control-checked-bgColor-rest);
border-color: var(--control-checked-borderColor-rest);
transition: background-color, border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0ms; /* unchecked -> checked */

&::before {
visibility: visible;
transition: visibility 0s linear 0s;
animation: checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards 80ms;
}
}

/* singleselect checkmark */
& .ActionListItem-singleSelectCheckmark {
visibility: visible;
}

/* checkbox */
& .ActionListItem-multiSelectIcon {
& .ActionListItem-multiSelectIconRect {
fill: var(--control-checked-bgColor-rest);
stroke: var(--control-checked-bgColor-rest);
stroke-width: var(--borderWidth-thin, 1px);
}

& .ActionListItem-multiSelectCheckmark {
fill: var(--fgColor-onEmphasis);
}
}
}

&[aria-checked='false'],
&[aria-selected='false'] {
/* multiselect checkmark */
& .ActionListItem-multiSelectCheckmark {
visibility: hidden;
opacity: 0;
transition:
visibility 0 linear 50ms,
opacity 50ms;
}

/* singleselect checkmark */
& .ActionListItem-singleSelectCheckmark {
visibility: hidden;
transition: visibility 0s linear 200ms;
}

/* checkbox */
& .ActionListItem-multiSelectIcon {
& .ActionListItem-multiSelectIconRect {
fill: var(--bgColor-default);
stroke: var(--control-borderColor-rest);
stroke-width: var(--borderWidth-thin, 1px);
}
}

& .ActionListItem-multiSelectIconRect {
fill: var(--bgColor-default);
border: var(--borderWidth-thin) solid var(--control-borderColor-rest);
}
}

/* sizes */
Expand Down
5 changes: 1 addition & 4 deletions app/components/primer/alpha/action_list/item.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
</span>
<% elsif list.select_variant == :multiple_checkbox %>
<span class="ActionListItem-visual ActionListItem-action--leading">
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" class="ActionListItem-multiSelectIcon">
<rect x="2" y="2" width="12" height="12" rx="4" class="ActionListItem-multiSelectIconRect"></rect>
<path fill-rule="evenodd" d="M4.03231 8.69862C3.84775 8.20646 4.49385 7.77554 4.95539 7.77554C5.41693 7.77554 6.80154 9.85246 6.80154 9.85246C6.80154 9.85246 10.2631 4.314 10.4938 4.08323C10.7246 3.85246 11.8785 4.08323 11.4169 5.00631C11.0081 5.82388 7.26308 11.4678 7.26308 11.4678C7.26308 11.4678 6.80154 12.1602 6.34 11.4678C5.87846 10.7755 4.21687 9.19077 4.03231 8.69862Z" class="ActionListItem-multiSelectCheckmark"></path>
</svg>
<div class="FormControl-checkbox"></div>
</span>
<% end %>
<% if leading_visual %>
Expand Down
5 changes: 2 additions & 3 deletions app/components/primer/alpha/text_field.pcss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* stylelint-disable selector-no-qualifying-type */
/* stylelint-disable selector-max-type */
/* stylelint-disable max-nesting-depth */
/* stylelint-disable selector-max-specificity */
Expand Down Expand Up @@ -578,7 +577,7 @@

/* these selectors are temporary to override base.scss
** once Field styles are widely adopted, we can adjust this and the global base styles */
input[type='checkbox'].FormControl-checkbox {
.FormControl-checkbox {
@mixin Field;

position: relative;
Expand Down Expand Up @@ -670,7 +669,7 @@ input[type='checkbox'].FormControl-checkbox {
}
}

input[type='radio'].FormControl-radio {
.FormControl-radio {
@mixin Field;

position: relative;
Expand Down
6 changes: 6 additions & 0 deletions static/classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@
"FormControl-check-group-wrap": [
"Primer::Alpha::TextField"
],
"FormControl-checkbox": [
"Primer::Alpha::TextField"
],
"FormControl-checkbox-wrap": [
"Primer::Alpha::TextField"
],
Expand Down Expand Up @@ -290,6 +293,9 @@
"FormControl-monospace": [
"Primer::Alpha::TextField"
],
"FormControl-radio": [
"Primer::Alpha::TextField"
],
"FormControl-radio-group-wrap": [
"Primer::Alpha::TextField"
],
Expand Down
2 changes: 2 additions & 0 deletions test/css/component_specific_selectors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class ComponentSpecificSelectorsTest < Minitest::Test
".FormControl-spacingWrapper",
".FormControl-horizontalGroup",
".FormControl-inlineValidation--success",
".FormControl-checkbox",
".FormControl-radio",
],
Primer::Alpha::ButtonMarketing => [
".btn-mktg.disabled",
Expand Down

0 comments on commit 3140ad9

Please sign in to comment.