Skip to content

Commit 922e1f1

Browse files
committed
feat(windows): add segment component
references #5565
1 parent 2699b44 commit 922e1f1

File tree

5 files changed

+93
-3
lines changed

5 files changed

+93
-3
lines changed

ionic/components.wp.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
"components/checkbox/checkbox.wp",
1414
"components/chip/chip.wp",
1515
"components/radio/radio.wp",
16+
"components/segment/segment.wp",
1617
"components/toolbar/toolbar.wp";

ionic/components/segment/segment.ios.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ $segment-button-ios-toolbar-icon-line-height: 2.4rem !default;
4242
color: $segment-button-ios-bg-color-activated;
4343
background-color: $segment-button-ios-bg-color;
4444

45+
flex: 1;
46+
width: 0;
47+
4548
ion-icon {
4649
font-size: $segment-button-ios-icon-size;
4750
line-height: $segment-button-ios-icon-line-height;

ionic/components/segment/segment.md.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ $segment-button-md-icon-line-height: $segment-button-md-line-height !d
3131
text-transform: uppercase;
3232
font-weight: 500;
3333

34+
flex: 1;
35+
width: 0;
36+
3437
opacity: 0.7;
3538
color: $segment-button-md-text-color-activated;
3639
background-color: transparent;

ionic/components/segment/segment.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ ion-segment {
1919
margin-left: 0;
2020
margin-right: 0;
2121

22-
flex: 1;
23-
width: 0;
24-
2522
overflow: hidden;
2623
text-align: center;
2724
text-overflow: ellipsis;
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
@import "../../globals.wp";
2+
@import "./segment";
3+
4+
// Windows Segment
5+
// --------------------------------------------------
6+
7+
$segment-button-wp-text-color-activated: $toolbar-wp-text-color !default;
8+
9+
$segment-button-wp-padding: 0 6px !default;
10+
$segment-button-wp-height: 4.0rem !default;
11+
$segment-button-wp-line-height: 4.0rem !default;
12+
$segment-button-wp-font-size: 1.3rem !default;
13+
$segment-button-wp-text-transform: uppercase !default;
14+
$segment-button-wp-font-weight: bold !default;
15+
$segment-button-wp-icon-size: 2.6rem !default;
16+
$segment-button-wp-icon-line-height: $segment-button-wp-line-height !default;
17+
$segment-button-wp-background-color: transparent !default;
18+
19+
$segment-button-wp-opacity: 0.7 !default;
20+
$segment-button-wp-opacity-activated: 1.0 !default;
21+
22+
$segment-button-wp-buttons-justify-content: flex-start !default;
23+
24+
ion-segment {
25+
justify-content: $segment-button-wp-buttons-justify-content;
26+
}
27+
28+
.segment-button {
29+
padding: $segment-button-wp-padding;
30+
31+
height: $segment-button-wp-height;
32+
line-height: $segment-button-wp-line-height;
33+
34+
font-size: $segment-button-wp-font-size;
35+
text-transform: $segment-button-wp-text-transform;
36+
font-weight: $segment-button-wp-font-weight;
37+
38+
opacity: $segment-button-wp-opacity;
39+
color: $segment-button-wp-text-color-activated;
40+
background-color: $segment-button-wp-background-color;
41+
42+
ion-icon {
43+
font-size: $segment-button-wp-icon-size;
44+
line-height: $segment-button-wp-icon-line-height;
45+
}
46+
}
47+
48+
.toolbar {
49+
50+
ion-segment {
51+
margin: 0 auto;
52+
}
53+
54+
.segment-button.activated,
55+
.segment-button.segment-activated {
56+
opacity: $segment-button-wp-opacity-activated;
57+
}
58+
59+
}
60+
61+
62+
// Windows Segment Button Mixin
63+
// --------------------------------------------------
64+
65+
@mixin wp-segment-button($color-name, $color-value) {
66+
67+
ion-segment[#{$color-name}] .segment-button {
68+
color: $color-value;
69+
70+
&.activated,
71+
&.segment-activated {
72+
opacity: $segment-button-wp-opacity-activated;
73+
border-color: $color-value;
74+
color: $color-value;
75+
}
76+
}
77+
78+
}
79+
80+
81+
// Windows Segment Color Generation
82+
// --------------------------------------------------
83+
84+
@each $color-name, $color-value in $colors-wp {
85+
@include wp-segment-button($color-name, $color-value);
86+
}

0 commit comments

Comments
 (0)