Skip to content

Commit 01c34f8

Browse files
committed
feat(newspack-ui): update segmented control to have a wide variant
1 parent 17db471 commit 01c34f8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/newspack-ui/scss/elements/_segmented-control.scss

+27
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
.newspack-ui {
22
&__segmented-control {
3+
// Base styles
34
align-items: center;
45
display: flex;
56
gap: var(--newspack-ui-spacer-2);
67
flex-direction: column;
78

9+
// Wide variant
10+
&--wide {
11+
display: flex;
12+
width: 100%;
13+
14+
.newspack-ui__segmented-control__tabs {
15+
width: 100%;
16+
17+
.newspack-ui__button {
18+
flex: 1 1 0; // Equal width distribution
19+
min-width: 0;
20+
white-space: nowrap;
21+
overflow: hidden;
22+
text-overflow: ellipsis;
23+
}
24+
}
25+
}
26+
27+
// Tabs container
828
&__tabs {
929
background: var(--newspack-ui-color-neutral-10);
1030
border-radius: var(--newspack-ui-border-radius-m);
@@ -14,12 +34,14 @@
1434
justify-content: center;
1535
padding: calc(var(--newspack-ui-spacer-base) / 2);
1636

37+
// Button styles
1738
.newspack-ui__button {
1839
background: transparent;
1940
border: 1px solid transparent;
2041
border-radius: var(--newspack-ui-border-radius-xs);
2142
color: var(--newspack-ui-color-neutral-60);
2243
cursor: pointer;
44+
margin: 0;
2345

2446
&:hover {
2547
background: transparent;
@@ -42,10 +64,15 @@
4264
background: var(--newspack-ui-color-neutral-0);
4365
border-color: var(--newspack-ui-color-neutral-30);
4466
color: var(--newspack-ui-color-neutral-90);
67+
68+
&:hover {
69+
background: var(--newspack-ui-color-neutral-0);
70+
}
4571
}
4672
}
4773
}
4874

75+
// Content panel styles
4976
&__content {
5077
width: 100%;
5178
}

0 commit comments

Comments
 (0)