mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
fix(range): add correct margin in item (#28161)
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
@import "../../themes/ionic.globals";
|
@import "../../themes/ionic.globals";
|
||||||
|
@import "./range.vars.scss";
|
||||||
|
|
||||||
// Range
|
// Range
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
@ -338,3 +339,11 @@
|
|||||||
*/
|
*/
|
||||||
max-width: calc(100% / #{$form-control-label-stacked-scale});
|
max-width: calc(100% / #{$form-control-label-stacked-scale});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host(.in-item.range-label-placement-stacked) .label-text-wrapper {
|
||||||
|
@include margin($range-item-label-margin-top, null, $form-control-label-margin, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
:host(.in-item.range-label-placement-stacked) .native-wrapper {
|
||||||
|
@include margin(null, null, $range-item-label-margin-bottom, null);
|
||||||
|
}
|
||||||
|
|||||||
8
core/src/components/range/range.vars.scss
Normal file
8
core/src/components/range/range.vars.scss
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/// @prop - Top margin of range's label when in an item
|
||||||
|
$range-item-label-margin-top: 10px !default;
|
||||||
|
|
||||||
|
/// @prop - Bottom margin of range's label when in an item
|
||||||
|
// We don't add additional margin because the native container
|
||||||
|
// has additional white space. Otherwise there would be too
|
||||||
|
// much white space at the bottom of the item.
|
||||||
|
$range-item-label-margin-bottom: 0px !default;
|
||||||
@ -50,3 +50,22 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config, screenshot }) => {
|
||||||
|
test.describe(title('range: stacked label in item'), () => {
|
||||||
|
test('should render margins correctly when using stacked label in item', async ({ page }) => {
|
||||||
|
await page.setContent(
|
||||||
|
`
|
||||||
|
<ion-list>
|
||||||
|
<ion-item>
|
||||||
|
<ion-range label="Temperature" label-placement="stacked"></ion-range>
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
`,
|
||||||
|
config
|
||||||
|
);
|
||||||
|
const list = page.locator('ion-list');
|
||||||
|
await expect(list).toHaveScreenshot(screenshot(`range-stacked-label-in-item`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user