Skip to content

Commit bba7dbf

Browse files
committed
feat(select): add helper and error text to the ionic theme
1 parent a0fa3b3 commit bba7dbf

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

core/src/components/select/select.common.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,21 +236,12 @@ button {
236236
// ----------------------------------------------------------------
237237

238238
.select-bottom {
239-
/**
240-
* The bottom content should take on the start and end
241-
* padding so it is always aligned with either the label
242-
* or the start of the text select.
243-
*/
244-
@include mixins.padding(5px, var(--padding-end), 0, var(--padding-start));
245-
246239
display: flex;
247240

248241
justify-content: space-between;
249242

250243
border-top: var(--border-width) var(--border-style) var(--border-color);
251244

252-
font-size: dynamic-font(12px);
253-
254245
white-space: normal;
255246
}
256247

@@ -285,8 +276,6 @@ button {
285276

286277
.select-bottom .helper-text {
287278
display: block;
288-
289-
color: $text-color-step-300;
290279
}
291280

292281
:host(.ion-touched.ion-invalid) .select-bottom .error-text {

core/src/components/select/select.ionic.outline.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
--border-color: #{globals.current-color(base)};
88
}
99

10+
// Select Bottom Content
11+
// ----------------------------------------------------------------
12+
13+
:host(.select-fill-outline) .select-bottom {
14+
border-top: none;
15+
}
16+
1017
// Select Label
1118
// ----------------------------------------------------------------
1219

core/src/components/select/select.ionic.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
--highlight-color-invalid: #{globals.$ion-semantics-danger-800};
2323
}
2424

25+
// Select Hint Text
26+
// ----------------------------------------------------------------
27+
28+
.select-bottom {
29+
@include globals.typography(globals.$ion-body-sm-medium);
30+
}
31+
32+
.select-bottom .helper-text {
33+
color: globals.$ion-primitives-neutral-800;
34+
}
35+
2536
// Select Label
2637
// ----------------------------------------------------------------
2738

core/src/components/select/select.native.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@
4141
@include border-radius(var(--border-radius));
4242
}
4343

44+
// Select Bottom Content
45+
// ----------------------------------------------------------------
46+
47+
.select-bottom {
48+
/**
49+
* The bottom content should take on the start and end
50+
* padding so it is always aligned with either the label
51+
* or the start of the text select.
52+
*/
53+
@include padding(5px, var(--padding-end), 0, var(--padding-start));
54+
55+
font-size: dynamic-font(12px);
56+
}
57+
58+
// Select Hint Text
59+
// ----------------------------------------------------------------
60+
61+
.select-bottom .helper-text {
62+
color: $text-color-step-300;
63+
}
64+
4465
// Select Label Placement - Start
4566
// ----------------------------------------------------------------
4667

core/src/components/select/test/bottom-content/select.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
9898
/**
9999
* Rendering is different across modes
100100
*/
101-
configs({ modes: ['ios', 'md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
101+
configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
102102
test.describe(title('select: helper text rendering'), () => {
103103
test('should not have visual regressions when rendering helper text', async ({ page }) => {
104104
await page.setContent(`<ion-select label="Label" helper-text="Helper text"></ion-select>`, config);

0 commit comments

Comments
 (0)