Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
@import "../../themes/native/native.globals";

// Radio Group
// Radio Group: Common
// --------------------------------------------------

ion-radio-group {
// Prevents additional pixels from being rendered on top
vertical-align: top;
}

.radio-group-wrapper {
display: inline;
}

// Radio Group: Top
// --------------------------------------------------

.radio-group-top {
line-height: 1.5;
}

/**
* Error text should only be shown when .ion-invalid is present
* on the radio group. Otherwise the helper text should be shown.
*/
.radio-group-top .error-text {
display: none;

color: ion-color(danger, base);
}

.radio-group-top .helper-text {
display: block;

color: $text-color-step-300;
}

.ion-touched.ion-invalid .radio-group-top .error-text {
Expand Down
38 changes: 38 additions & 0 deletions core/src/components/radio-group/radio-group.ionic.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@use "../../themes/ionic/ionic.globals" as globals;
@import "./radio-group.common";

// Ionic Radio Group Top
// --------------------------------------------------

.radio-group-top {
@include globals.typography(globals.$ion-body-md-regular);

margin-bottom: globals.$ion-space-400;
}

.radio-group-top .error-text {
color: globals.$ion-semantics-danger-800;
}

.radio-group-top .helper-text {
color: globals.$ion-primitives-neutral-800;
}

// Radio Group Top: in List
// --------------------------------------------------

// Add padding to the error and helper text when used in a
// list to align them with the list header and item text.
ion-list .radio-group-top {
/* stylelint-disable */
@include globals.ltr() {
padding-right: globals.$ion-space-400;
padding-left: calc(globals.$ion-space-400 + var(--ion-safe-area-left, 0px));
}

@include globals.rtl() {
padding-right: calc(globals.$ion-space-400 + var(--ion-safe-area-right, 0px));
padding-left: globals.$ion-space-400;
}
/* stylelint-enable */
}
2 changes: 1 addition & 1 deletion core/src/components/radio-group/radio-group.ios.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../../themes/native/native.globals.ios";
@import "./radio-group";
@import "./radio-group.native";
@import "../item/item.ios.vars";

// iOS Radio Group Top in List
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/radio-group/radio-group.md.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../../themes/native/native.globals.md";
@import "./radio-group";
@import "./radio-group.native";
@import "../item/item.md.vars";

// Material Design Radio Group Top in List
Expand Down
24 changes: 24 additions & 0 deletions core/src/components/radio-group/radio-group.native.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@import "./radio-group.common";
@import "../../themes/native/native.globals";

// Radio Group: Native
// --------------------------------------------------

.radio-group-wrapper {
display: inline;
}

// Radio Group: Top
// --------------------------------------------------

.radio-group-top {
line-height: 1.5;
}

.radio-group-top .error-text {
color: ion-color(danger, base);
}

.radio-group-top .helper-text {
color: $text-color-step-300;
}
1 change: 1 addition & 0 deletions core/src/components/radio-group/radio-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { RadioGroupChangeEventDetail, RadioGroupCompareFn } from './radio-g
styleUrls: {
ios: 'radio-group.ios.scss',
md: 'radio-group.md.scss',
ionic: 'radio-group.ionic.scss',
},
})
export class RadioGroup implements ComponentInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
/**
* Rendering is different across modes
*/
configs({ modes: ['ios', 'md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('radio-group: supporting text rendering'), () => {
test('should not have visual regressions when rendering helper text', async ({ page }) => {
await page.setContent(
Expand Down
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