Skip to content
Draft
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
31 changes: 17 additions & 14 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1291,20 +1291,23 @@ ion-datetime-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
ion-datetime-button,part,native

ion-divider,shadow
ion-divider,prop,inset,boolean,false,false,false
ion-divider,prop,spacing,"large" | "medium" | "small" | "xlarge" | "xsmall" | "xxlarge" | "xxsmall" | undefined,'medium',false,true
ion-divider,css-prop,--margin-bottom,ionic
ion-divider,css-prop,--margin-bottom,ios
ion-divider,css-prop,--margin-bottom,md
ion-divider,css-prop,--margin-top,ionic
ion-divider,css-prop,--margin-top,ios
ion-divider,css-prop,--margin-top,md
ion-divider,css-prop,--padding-end,ionic
ion-divider,css-prop,--padding-end,ios
ion-divider,css-prop,--padding-end,md
ion-divider,css-prop,--padding-start,ionic
ion-divider,css-prop,--padding-start,ios
ion-divider,css-prop,--padding-start,md
ion-divider,prop,spacing,"large" | "medium" | "none" | "small" | "xlarge" | "xsmall" | "xxlarge" | "xxsmall" | undefined,undefined,false,true
ion-divider,css-prop,--ion-divider-color
ion-divider,css-prop,--ion-divider-spacing-large-margin-bottom
ion-divider,css-prop,--ion-divider-spacing-large-margin-top
ion-divider,css-prop,--ion-divider-spacing-medium-margin-bottom
ion-divider,css-prop,--ion-divider-spacing-medium-margin-top
ion-divider,css-prop,--ion-divider-spacing-small-margin-bottom
ion-divider,css-prop,--ion-divider-spacing-small-margin-top
ion-divider,css-prop,--ion-divider-spacing-xlarge-margin-bottom
ion-divider,css-prop,--ion-divider-spacing-xlarge-margin-top
ion-divider,css-prop,--ion-divider-spacing-xsmall-margin-bottom
ion-divider,css-prop,--ion-divider-spacing-xsmall-margin-top
ion-divider,css-prop,--ion-divider-spacing-xxlarge-margin-bottom
ion-divider,css-prop,--ion-divider-spacing-xxlarge-margin-top
ion-divider,css-prop,--ion-divider-spacing-xxsmall-margin-bottom
ion-divider,css-prop,--ion-divider-spacing-xxsmall-margin-top
ion-divider,css-prop,--ion-divider-thickness

ion-fab,shadow
ion-fab,prop,activated,boolean,false,false,false
Expand Down
25 changes: 7 additions & 18 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { IonChipFill, IonChipShape, IonChipSize } from "./components/chip/chip.i
import { IonColValue } from "./components/col/col.interface";
import { ScrollBaseDetail, ScrollDetail } from "./components/content/content.interface";
import { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimeParts, DatetimePresentation, FormatOptions, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
import { IonDividerSpacing } from "./components/divider/divider.interface";
import { FooterScrollEffect } from "./components/footer/footer-interface";
import { IonGalleryColumns, IonGalleryGap } from "./components/gallery/gallery.interface";
import { HeaderScrollEffect } from "./components/header/header-interface";
Expand Down Expand Up @@ -70,6 +71,7 @@ export { IonChipFill, IonChipShape, IonChipSize } from "./components/chip/chip.i
export { IonColValue } from "./components/col/col.interface";
export { ScrollBaseDetail, ScrollDetail } from "./components/content/content.interface";
export { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimeParts, DatetimePresentation, FormatOptions, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
export { IonDividerSpacing } from "./components/divider/divider.interface";
export { FooterScrollEffect } from "./components/footer/footer-interface";
export { IonGalleryColumns, IonGalleryGap } from "./components/gallery/gallery.interface";
export { HeaderScrollEffect } from "./components/header/header-interface";
Expand Down Expand Up @@ -1350,15 +1352,9 @@ export namespace Components {
}
interface IonDivider {
/**
* If `true`, the divider will have horizontal margins By default, it's `false`
* @default false
*/
"inset": boolean;
/**
* Set to `"xxsmall"` for the smallest spacing. Set to "xsmall" for very small spacing. Set to `"small"` for small spacing. Set to "medium" for medium spacing. Set to "large" for large spacing. Set to `"xlarge"` for the largest spacing. Defaults to `"medium"`.
* @default 'medium'
* Controls the space above and below the line. Set to `"none"` for no spacing. Set to `"xxsmall"` for the smallest spacing. Set to `"xsmall"` for very small spacing. Set to `"small"` for small spacing. Set to `"medium"` for medium spacing. Set to `"large"` for large spacing. Set to `"xlarge"` for very large spacing. Set to `"xxlarge"` for the largest spacing. Defaults to `"medium"` if both the spacing property and theme config are unset.
*/
"spacing"?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
"spacing"?: IonDividerSpacing;
}
interface IonFab {
/**
Expand Down Expand Up @@ -7228,15 +7224,9 @@ declare namespace LocalJSX {
}
interface IonDivider {
/**
* If `true`, the divider will have horizontal margins By default, it's `false`
* @default false
* Controls the space above and below the line. Set to `"none"` for no spacing. Set to `"xxsmall"` for the smallest spacing. Set to `"xsmall"` for very small spacing. Set to `"small"` for small spacing. Set to `"medium"` for medium spacing. Set to `"large"` for large spacing. Set to `"xlarge"` for very large spacing. Set to `"xxlarge"` for the largest spacing. Defaults to `"medium"` if both the spacing property and theme config are unset.
*/
"inset"?: boolean;
/**
* Set to `"xxsmall"` for the smallest spacing. Set to "xsmall" for very small spacing. Set to `"small"` for small spacing. Set to "medium" for medium spacing. Set to "large" for large spacing. Set to `"xlarge"` for the largest spacing. Defaults to `"medium"`.
* @default 'medium'
*/
"spacing"?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
"spacing"?: IonDividerSpacing;
}
interface IonFab {
/**
Expand Down Expand Up @@ -10664,8 +10654,7 @@ declare namespace LocalJSX {
"datetime": string;
}
interface IonDividerAttributes {
"spacing": 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
"inset": boolean;
"spacing": IonDividerSpacing;
}
interface IonFabAttributes {
"horizontal": 'start' | 'end' | 'center';
Expand Down
18 changes: 18 additions & 0 deletions core/src/components/divider/_divider.docs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* @prop --ion-divider-color: Color of the divider line
* @prop --ion-divider-spacing-xxsmall-margin-top: Top margin of the `xxsmall` divider spacing
* @prop --ion-divider-spacing-xxsmall-margin-bottom: Bottom margin of the `xxsmall` divider spacing
* @prop --ion-divider-spacing-xsmall-margin-top: Top margin of the `xsmall` divider spacing
* @prop --ion-divider-spacing-xsmall-margin-bottom: Bottom margin of the `xsmall` divider spacing
* @prop --ion-divider-spacing-small-margin-top: Top margin of the `small` divider spacing
* @prop --ion-divider-spacing-small-margin-bottom: Bottom margin of the `small` divider spacing
* @prop --ion-divider-spacing-medium-margin-top: Top margin of the `medium` divider spacing
* @prop --ion-divider-spacing-medium-margin-bottom: Bottom margin of the `medium` divider spacing
* @prop --ion-divider-spacing-large-margin-top: Top margin of the `large` divider spacing
* @prop --ion-divider-spacing-large-margin-bottom: Bottom margin of the `large` divider spacing
* @prop --ion-divider-spacing-xlarge-margin-top: Top margin of the `xlarge` divider spacing
* @prop --ion-divider-spacing-xlarge-margin-bottom: Bottom margin of the `xlarge` divider spacing
* @prop --ion-divider-spacing-xxlarge-margin-top: Top margin of the `xxlarge` divider spacing
* @prop --ion-divider-spacing-xxlarge-margin-bottom: Bottom margin of the `xxlarge` divider spacing
* @prop --ion-divider-thickness: Thickness of the divider line
*/
31 changes: 0 additions & 31 deletions core/src/components/divider/divider.common.scss

This file was deleted.

34 changes: 34 additions & 0 deletions core/src/components/divider/divider.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { IonMargin } from '../../themes/themes.interfaces';

export type IonDividerRecipe = {
/** Color of the divider line. */
color?: string;

/** Applies for each value of the `spacing` property, except `"none"`, which is always 0. */
spacing?: {
[K in Exclude<IonDividerSpacing, 'none'>]?: {
/** Space above and below the line. Collapses with the margins of adjacent elements. */
margin?: Pick<IonMargin, 'top' | 'bottom'>;
};
};

/** Thickness of the divider line. */
thickness?: string;
};

export type IonDividerConfig = {
/** Spacing used when the `spacing` property is not set. */
spacing?: IonDividerSpacing;
};

export const ION_DIVIDER_SPACINGS = [
'none',
'xxsmall',
'xsmall',
'small',
'medium',
'large',
'xlarge',
'xxlarge',
] as const;
export type IonDividerSpacing = (typeof ION_DIVIDER_SPACINGS)[number];
47 changes: 0 additions & 47 deletions core/src/components/divider/divider.ionic.scss

This file was deleted.

4 changes: 0 additions & 4 deletions core/src/components/divider/divider.ios.scss

This file was deleted.

4 changes: 0 additions & 4 deletions core/src/components/divider/divider.md.scss

This file was deleted.

46 changes: 0 additions & 46 deletions core/src/components/divider/divider.native.scss

This file was deleted.

52 changes: 52 additions & 0 deletions core/src/components/divider/divider.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@use "../../themes/mixins" as mixins;
@use "./divider.docs";

// Divider
// --------------------------------------------------

$spacings: xxsmall, xsmall, small, medium, large, xlarge, xxlarge;

:host {
/**
* Ancestors such as `ion-item` or `.ion-padding` containers set `--padding-*`
* for themselves, and the divider would inherit them. The reset limits them
* to values set on the divider, such as its own `ion-padding` classes.
*/
--margin-top: initial;
--margin-bottom: initial;
--padding-start: initial;
--padding-end: initial;

@include mixins.padding-horizontal(var(--padding-start, 0px), var(--padding-end, 0px));

display: block;

width: 100%;
}

:host hr {
display: block;

width: 100%;

border: none;
border-top-width: var(--ion-divider-thickness);
border-top-style: solid;
border-top-color: var(--ion-divider-color);
}

// Divider Spacing
// --------------------------------------------------

// No theme token: `none` is always 0. The app's `--margin-*` still applies.
:host(.divider-spacing-none) hr {
margin-top: var(--margin-top, 0);
margin-bottom: var(--margin-bottom, 0);
}

@each $spacing in $spacings {
:host(.divider-spacing-#{$spacing}) hr {
margin-top: var(--margin-top, var(--ion-divider-spacing-#{$spacing}-margin-top));
margin-bottom: var(--margin-bottom, var(--ion-divider-spacing-#{$spacing}-margin-bottom));
}
}
Loading
Loading