Skip to content

Commit a4293bf

Browse files
authored
TreeView: remove bold active items + markup changes (#1996)
* remove overrides + fix bold label * Create curvy-ways-taste.md * thank you stylelint * lint * lint
1 parent ef3be81 commit a4293bf

File tree

2 files changed

+18
-79
lines changed

2 files changed

+18
-79
lines changed

.changeset/curvy-ways-taste.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
TreeView: remove bold active items + markup changes

src/actionlist/action-list-tree.scss

+13-79
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, no-duplicate-selectors, selector-max-type
1+
// stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, selector-max-type, primer/spacing
22
// tree-view variant
33
// renders ActionList with default styling for tree-view
44
// collapse/expand icons presents as leadingActions, rotate 90deg
@@ -40,87 +40,15 @@
4040
}
4141
}
4242

43-
// start: copy from ActionList proper- backwards compatible for treeview with different markup structure
44-
&[aria-expanded] {
45-
.ActionList--subGroup {
46-
@media screen and (prefers-reduced-motion: no-preference) {
47-
transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
48-
}
49-
50-
.ActionList-content {
51-
padding-left: $spacer-4;
52-
}
53-
}
54-
55-
// has 16px leading visual
56-
.ActionList-content--visual16 + .ActionList--subGroup {
57-
.ActionList-content {
58-
padding-left: $spacer-5;
59-
}
60-
}
61-
62-
// has 20px leading visual
63-
.ActionList-content--visual20 + .ActionList--subGroup {
64-
.ActionList-content {
65-
padding-left: $spacer-2 * 4.5; // 36px
66-
}
67-
}
68-
69-
// has 24px leading visual
70-
.ActionList-content--visual24 + .ActionList--subGroup {
71-
.ActionList-content {
72-
padding-left: $spacer-6;
43+
// normal font-weight for any active item
44+
&.ActionList-item--navActive {
45+
&:not(.ActionList-item--subItem) {
46+
.ActionList-item-label {
47+
font-weight: $font-weight-normal;
7348
}
7449
}
7550
}
7651

77-
&[aria-expanded='true'] {
78-
.ActionList-item-collapseIcon {
79-
transition: transform 120ms linear;
80-
transform: scaleY(-1);
81-
}
82-
83-
.ActionList--subGroup {
84-
height: auto;
85-
overflow: visible;
86-
visibility: visible;
87-
opacity: 1;
88-
transform: translateY(0);
89-
}
90-
}
91-
92-
&[aria-expanded='false'] {
93-
.ActionList-item-collapseIcon {
94-
transition: transform 120ms linear;
95-
transform: scaleY(1);
96-
}
97-
98-
.ActionList--subGroup {
99-
height: 0;
100-
overflow: hidden;
101-
visibility: hidden;
102-
opacity: 0;
103-
transform: translateY(-$spacer-3);
104-
}
105-
106-
// show active indicator on parent collapse if child is active
107-
// this class changed in ActionList proper
108-
&.ActionList-item--hasActiveSubItem {
109-
background: var(--color-action-list-item-default-selected-bg);
110-
111-
&::before,
112-
+ .ActionList-item::before {
113-
visibility: hidden;
114-
}
115-
116-
// blue accent line
117-
&::after {
118-
@include activeIndicatorLine;
119-
}
120-
}
121-
}
122-
// end copy
123-
12452
// nesting (infinite levels)
12553
// target items inside expanded subgroup
12654
&[aria-expanded] {
@@ -129,7 +57,6 @@
12957

13058
// --ActionList-tree-depth is defined as an inline style referencing the aria-level of each item ie: aria-level="2"
13159
.ActionList-content {
132-
// stylelint-disable-next-line primer/spacing
13360
padding-left: calc(#{$spacer-2} * var(--ActionList-tree-depth));
13461
}
13562
}
@@ -141,6 +68,13 @@
14168
transition: transform 120ms linear;
14269
transform: rotate(0deg);
14370
}
71+
72+
// normal weight for parent folder containing active child
73+
.ActionList-content--hasActiveSubItem {
74+
>.ActionList-item-label {
75+
font-weight: $font-weight-normal;
76+
}
77+
}
14478
}
14579

14680
&[aria-expanded='false'] {

0 commit comments

Comments
 (0)