diff --git a/core/api.txt b/core/api.txt index 4ae8c28d0c..d43097b628 100644 --- a/core/api.txt +++ b/core/api.txt @@ -26,7 +26,15 @@ ion-action-sheet,event,ionActionSheetDidPresent,void,true ion-action-sheet,event,ionActionSheetDidUnload,void,true ion-action-sheet,event,ionActionSheetWillDismiss,OverlayEventDetail,true ion-action-sheet,event,ionActionSheetWillPresent,void,true +ion-action-sheet,css-prop,--background +ion-action-sheet,css-prop,--background-activated +ion-action-sheet,css-prop,--background-selected +ion-action-sheet,css-prop,--color +ion-action-sheet,css-prop,--height +ion-action-sheet,css-prop,--max-height ion-action-sheet,css-prop,--max-width +ion-action-sheet,css-prop,--min-height +ion-action-sheet,css-prop,--min-width ion-action-sheet,css-prop,--width ion-alert-controller @@ -59,8 +67,12 @@ ion-alert,event,ionAlertDidUnload,void,true ion-alert,event,ionAlertWillDismiss,OverlayEventDetail,true ion-alert,event,ionAlertWillPresent,void,true ion-alert,css-prop,--background +ion-alert,css-prop,--height ion-alert,css-prop,--max-height +ion-alert,css-prop,--max-width +ion-alert,css-prop,--min-height ion-alert,css-prop,--min-width +ion-alert,css-prop,--width ion-anchor ion-anchor,prop,color,string | undefined,undefined,false @@ -152,11 +164,6 @@ ion-button,css-prop,--box-shadow ion-button,css-prop,--color ion-button,css-prop,--color-activated ion-button,css-prop,--color-focused -ion-button,css-prop,--height -ion-button,css-prop,--margin-bottom -ion-button,css-prop,--margin-end -ion-button,css-prop,--margin-start -ion-button,css-prop,--margin-top ion-button,css-prop,--opacity ion-button,css-prop,--padding-bottom ion-button,css-prop,--padding-end @@ -164,7 +171,6 @@ ion-button,css-prop,--padding-start ion-button,css-prop,--padding-top ion-button,css-prop,--ripple-color ion-button,css-prop,--transition -ion-button,css-prop,--width ion-buttons @@ -210,9 +216,8 @@ ion-checkbox,css-prop,--border-radius ion-checkbox,css-prop,--border-style ion-checkbox,css-prop,--border-width ion-checkbox,css-prop,--checkmark-color -ion-checkbox,css-prop,--height +ion-checkbox,css-prop,--size ion-checkbox,css-prop,--transition -ion-checkbox,css-prop,--width ion-chip ion-chip,prop,color,string | undefined,undefined,false @@ -335,18 +340,12 @@ ion-fab-button,css-prop,--box-shadow ion-fab-button,css-prop,--color ion-fab-button,css-prop,--color-activated ion-fab-button,css-prop,--color-focused -ion-fab-button,css-prop,--height -ion-fab-button,css-prop,--margin-bottom -ion-fab-button,css-prop,--margin-end -ion-fab-button,css-prop,--margin-start -ion-fab-button,css-prop,--margin-top ion-fab-button,css-prop,--padding-bottom ion-fab-button,css-prop,--padding-end ion-fab-button,css-prop,--padding-start ion-fab-button,css-prop,--padding-top ion-fab-button,css-prop,--ripple-color ion-fab-button,css-prop,--transition -ion-fab-button,css-prop,--width ion-fab-list ion-fab-list,prop,activated,boolean,false,false @@ -563,6 +562,14 @@ ion-loading,event,ionLoadingDidPresent,void,true ion-loading,event,ionLoadingDidUnload,void,true ion-loading,event,ionLoadingWillDismiss,OverlayEventDetail,true ion-loading,event,ionLoadingWillPresent,void,true +ion-loading,css-prop,--background +ion-loading,css-prop,--height +ion-loading,css-prop,--max-height +ion-loading,css-prop,--max-width +ion-loading,css-prop,--min-height +ion-loading,css-prop,--min-width +ion-loading,css-prop,--spinner-color +ion-loading,css-prop,--width ion-menu-button ion-menu-button,prop,autoHide,boolean,true,false @@ -608,8 +615,12 @@ ion-menu,event,ionDidOpen,void,true ion-menu,event,ionWillClose,void,true ion-menu,event,ionWillOpen,void,true ion-menu,css-prop,--background +ion-menu,css-prop,--height +ion-menu,css-prop,--max-height +ion-menu,css-prop,--max-width +ion-menu,css-prop,--min-height +ion-menu,css-prop,--min-width ion-menu,css-prop,--width -ion-menu,css-prop,--width-small ion-modal-controller ion-modal-controller,method,create,create(opts: ModalOptions) => Promise @@ -643,6 +654,10 @@ ion-modal,css-prop,--border-radius ion-modal,css-prop,--border-style ion-modal,css-prop,--border-width ion-modal,css-prop,--height +ion-modal,css-prop,--max-height +ion-modal,css-prop,--max-width +ion-modal,css-prop,--min-height +ion-modal,css-prop,--min-width ion-modal,css-prop,--width ion-nav-pop @@ -713,6 +728,18 @@ ion-picker,event,ionPickerDidPresent,void,true ion-picker,event,ionPickerDidUnload,void,true ion-picker,event,ionPickerWillDismiss,OverlayEventDetail,true ion-picker,event,ionPickerWillPresent,void,true +ion-picker,css-prop,--background +ion-picker,css-prop,--background-rgb +ion-picker,css-prop,--border-color +ion-picker,css-prop,--border-radius +ion-picker,css-prop,--border-style +ion-picker,css-prop,--border-width +ion-picker,css-prop,--height +ion-picker,css-prop,--max-height +ion-picker,css-prop,--max-width +ion-picker,css-prop,--min-height +ion-picker,css-prop,--min-width +ion-picker,css-prop,--width ion-popover-controller ion-popover-controller,method,create,create(opts: PopoverOptions) => Promise @@ -742,6 +769,14 @@ ion-popover,event,ionPopoverDidPresent,void,true ion-popover,event,ionPopoverDidUnload,void,true ion-popover,event,ionPopoverWillDismiss,OverlayEventDetail,true ion-popover,event,ionPopoverWillPresent,void,true +ion-popover,css-prop,--background +ion-popover,css-prop,--box-shadow +ion-popover,css-prop,--height +ion-popover,css-prop,--max-height +ion-popover,css-prop,--max-width +ion-popover,css-prop,--min-height +ion-popover,css-prop,--min-width +ion-popover,css-prop,--width ion-progress-bar ion-progress-bar,prop,buffer,number,1,false @@ -774,10 +809,6 @@ ion-radio,event,ionRadioDidUnload,void,true ion-radio,event,ionSelect,CheckedInputChangeEvent,true ion-radio,css-prop,--color ion-radio,css-prop,--color-checked -ion-radio,css-prop,--height -ion-radio,css-prop,--inner-height -ion-radio,css-prop,--inner-width -ion-radio,css-prop,--width ion-range ion-range,prop,color,string | undefined,undefined,false @@ -1150,6 +1181,12 @@ ion-toast,css-prop,--border-width ion-toast,css-prop,--box-shadow ion-toast,css-prop,--button-color ion-toast,css-prop,--color +ion-toast,css-prop,--height +ion-toast,css-prop,--max-height +ion-toast,css-prop,--max-width +ion-toast,css-prop,--min-height +ion-toast,css-prop,--min-width +ion-toast,css-prop,--width ion-toggle ion-toggle,prop,checked,boolean,false,false diff --git a/core/src/components/action-sheet/action-sheet.ios.scss b/core/src/components/action-sheet/action-sheet.ios.scss index 59568475bf..366375c773 100644 --- a/core/src/components/action-sheet/action-sheet.ios.scss +++ b/core/src/components/action-sheet/action-sheet.ios.scss @@ -5,6 +5,10 @@ // -------------------------------------------------- :host { + --background: #{$action-sheet-ios-background-color}; + --background-selected: #{var(--background, $action-sheet-ios-button-background-selected)}; + --background-activated: #{$action-sheet-ios-button-background-activated}; + text-align: $action-sheet-ios-text-align; } @@ -27,8 +31,6 @@ .action-sheet-group { @include border-radius($action-sheet-ios-border-radius); @include margin(null, null, $action-sheet-ios-group-margin-bottom - 2, null); - - background: $action-sheet-ios-background-color; } .action-sheet-group:first-child { @@ -57,7 +59,7 @@ border-bottom: $action-sheet-ios-title-border-width $action-sheet-ios-title-border-style $action-sheet-ios-title-border-color; - color: $action-sheet-ios-title-color; + color: var(--color, $action-sheet-ios-title-color); font-size: $action-sheet-ios-title-font-size; font-weight: $action-sheet-ios-title-font-weight; @@ -83,8 +85,8 @@ border-bottom: $action-sheet-ios-button-border-width $action-sheet-ios-button-border-style $action-sheet-ios-button-border-color; - background: $action-sheet-ios-button-background; - color: $action-sheet-ios-button-text-color; + background: transparent; + color: var(--color, $action-sheet-ios-button-text-color); font-size: $action-sheet-ios-button-font-size; @@ -104,15 +106,11 @@ .action-sheet-button.activated { @include margin(-$action-sheet-ios-button-border-width, null, null, null); - border-top: $action-sheet-ios-button-border-width $action-sheet-ios-button-border-style $action-sheet-ios-button-background-activated; - border-bottom-color: $action-sheet-ios-button-background-activated; - - background: $action-sheet-ios-button-background-activated; + border-top: $action-sheet-ios-button-border-width $action-sheet-ios-button-border-style var(--background-activated); + border-bottom-color: var(--background-activated); } .action-sheet-selected { - background: $action-sheet-ios-button-background-selected; - font-weight: bold; } @@ -121,7 +119,7 @@ } .action-sheet-cancel { - background: $action-sheet-ios-button-cancel-background; + background: var(--background-selected); font-weight: $action-sheet-ios-button-cancel-font-weight; } diff --git a/core/src/components/action-sheet/action-sheet.md.scss b/core/src/components/action-sheet/action-sheet.md.scss index f87d7931e8..79d577d9b5 100644 --- a/core/src/components/action-sheet/action-sheet.md.scss +++ b/core/src/components/action-sheet/action-sheet.md.scss @@ -4,12 +4,18 @@ // Material Design Action Sheet Title // ----------------------------------------- +:host { + --background: #{$action-sheet-md-background-color}; + --background-selected: #{var(--background, $action-sheet-md-button-background-selected)}; + --background-activated: var(--background); +} + .action-sheet-title { @include padding($action-sheet-md-title-padding-top, $action-sheet-md-title-padding-end, $action-sheet-md-title-padding-bottom, $action-sheet-md-title-padding-start); height: $action-sheet-md-title-height; - color: $action-sheet-md-title-color; + color: var(--color, $action-sheet-md-title-color); font-size: $action-sheet-md-title-font-size; @@ -26,10 +32,6 @@ // Material Design Action Sheet Group // ----------------------------------------- -.action-sheet-group { - background-color: $action-sheet-md-background-color; -} - .action-sheet-group:first-child { @include padding($action-sheet-md-padding-top, null, null, null); } @@ -49,8 +51,8 @@ height: $action-sheet-md-button-height; - background: $action-sheet-md-button-background; - color: $action-sheet-md-button-text-color; + background: transparent; + color: var(--color, $action-sheet-md-button-text-color); font-size: $action-sheet-md-button-font-size; @@ -64,7 +66,7 @@ @include padding(null, null, 4px, null); @include margin($action-sheet-md-icon-margin-top, $action-sheet-md-icon-margin-end, $action-sheet-md-icon-margin-bottom, $action-sheet-md-icon-margin-start); - color: $action-sheet-md-icon-color; + color: var(--color, $action-sheet-md-icon-color); font-size: $action-sheet-md-icon-font-size; } @@ -74,7 +76,5 @@ } .action-sheet-selected { - background-color: $action-sheet-md-button-background-selected; - font-weight: bold; } diff --git a/core/src/components/action-sheet/action-sheet.scss b/core/src/components/action-sheet/action-sheet.scss index 62684b643a..d310d03c10 100644 --- a/core/src/components/action-sheet/action-sheet.scss +++ b/core/src/components/action-sheet/action-sheet.scss @@ -5,11 +5,26 @@ :host { /** + * @prop --background: Background of the action sheet group + * @prop --background-activated: Background of the activated action sheet button + * @prop --background-selected: Background of the selected action sheet button + * @prop --color: Color of the action sheet text + * + * @prop --min-width: Minimum width of the action sheet * @prop --width: Width of the action sheet * @prop --max-width: Maximum width of the action sheet + * + * @prop --min-height: Minimum height of the action sheet + * @prop --height: height of the action sheet + * @prop --max-height: Maximum height of the action sheet */ + --color: initial; + --min-width: auto; --width: #{$action-sheet-width}; --max-width: #{$action-sheet-max-width}; + --min-height: auto; + --height: auto; + --max-height: auto; @include font-smoothing(); @include position(0, 0, 0, 0); @@ -25,7 +40,7 @@ } .action-sheet-wrapper { - @include position(0, 0, 0, 0); + @include position(null, 0, 0, 0); @include margin(auto); @include transform(translate3d(0, 100%, 0)); @@ -33,14 +48,19 @@ position: absolute; width: var(--width); + min-width: var(--min-width); max-width: var(--max-width); + height: var(--height); + min-height: var(--min-height); + max-height: var(--max-height); + z-index: $z-index-overlay-wrapper; pointer-events: none; } .action-sheet-button { - width: var(--width); + width: 100%; border: 0; @@ -49,6 +69,10 @@ font-family: inherit; } +.action-sheet-button.activated { + background: var(--background-activated); +} + .action-sheet-button-inner { display: flex; @@ -77,6 +101,8 @@ overflow-y: scroll; -webkit-overflow-scrolling: touch; pointer-events: all; + + background: var(--background); } .action-sheet-group::-webkit-scrollbar { @@ -88,3 +114,7 @@ overflow: hidden; } + +.action-sheet-selected { + background: var(--background-selected); +} \ No newline at end of file diff --git a/core/src/components/action-sheet/readme.md b/core/src/components/action-sheet/readme.md index d396873624..cd9dff9e89 100644 --- a/core/src/components/action-sheet/readme.md +++ b/core/src/components/action-sheet/readme.md @@ -205,10 +205,18 @@ Type: `Promise` ## CSS Custom Properties -| Name | Description | -| ------------- | --------------------------------- | -| `--max-width` | Maximum width of the action sheet | -| `--width` | Width of the action sheet | +| Name | Description | +| ------------------------ | ----------------------------------------------- | +| `--background` | Background of the action sheet group | +| `--background-activated` | Background of the activated action sheet button | +| `--background-selected` | Background of the selected action sheet button | +| `--color` | Color of the action sheet text | +| `--height` | height of the action sheet | +| `--max-height` | Maximum height of the action sheet | +| `--max-width` | Maximum width of the action sheet | +| `--min-height` | Minimum height of the action sheet | +| `--min-width` | Minimum width of the action sheet | +| `--width` | Width of the action sheet | ---------------------------------------------- diff --git a/core/src/components/action-sheet/test/custom-css/index.html b/core/src/components/action-sheet/test/custom-css/index.html deleted file mode 100644 index 9ac9783391..0000000000 --- a/core/src/components/action-sheet/test/custom-css/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Action Sheet - Custom CSS Class - - - - - - - - - - - - Action Sheet - Custom CSS Class - - - - - - - Custom CSS Class - - - - - - - - - - - diff --git a/core/src/components/action-sheet/test/custom-css/e2e.ts b/core/src/components/action-sheet/test/custom/e2e.ts similarity index 64% rename from core/src/components/action-sheet/test/custom-css/e2e.ts rename to core/src/components/action-sheet/test/custom/e2e.ts index ac16ecc40d..cdb9346a8f 100644 --- a/core/src/components/action-sheet/test/custom-css/e2e.ts +++ b/core/src/components/action-sheet/test/custom/e2e.ts @@ -1,11 +1,11 @@ import { newE2EPage } from '@stencil/core/testing'; -test('action-sheet: cssClass', async () => { +test('action-sheet: custom', async () => { const page = await newE2EPage({ - url: `/src/components/action-sheet/test/custom-css?ionic:_testing=true` + url: `/src/components/action-sheet/test/custom?ionic:_testing=true` }); - const presentBtn = await page.find('#cssClass'); + const presentBtn = await page.find('#custom'); await presentBtn.click(); const actionSheet = await page.find('ion-action-sheet'); diff --git a/core/src/components/action-sheet/test/custom/index.html b/core/src/components/action-sheet/test/custom/index.html new file mode 100644 index 0000000000..290b8b5840 --- /dev/null +++ b/core/src/components/action-sheet/test/custom/index.html @@ -0,0 +1,121 @@ + + + + + + Action Sheet - Custom CSS Class + + + + + + + + + + + + Action Sheet - Custom CSS Class + + + + + + + Custom CSS Class + +
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur + sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur + sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur + sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur + sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+ + + +
+ + + + + diff --git a/core/src/components/alert/alert.scss b/core/src/components/alert/alert.scss index 36f0a76bb6..e4cd5f5007 100644 --- a/core/src/components/alert/alert.scss +++ b/core/src/components/alert/alert.scss @@ -6,10 +6,19 @@ :host { /** * @prop --background: Background of the alert + * * @prop --min-width: Minimum width of the alert + * @prop --width: Width of the alert + * @prop --max-width: Maximum width of the alert + * + * @prop --min-height: Minimum height of the alert + * @prop --height: Height of the alert * @prop --max-height: Maximum height of the alert */ --min-width: #{$alert-min-width}; + --width: auto; + --min-height: auto; + --height: auto; --max-height: #{$alert-max-height}; @include font-smoothing(); @@ -40,9 +49,12 @@ flex-direction: column; + width: var(--width); min-width: var(--min-width); max-width: var(--max-width); + height: var(--height); + min-height: var(--min-height); max-height: var(--max-height); background: var(--background); diff --git a/core/src/components/alert/readme.md b/core/src/components/alert/readme.md index e22d8abec6..dbca70a6a3 100644 --- a/core/src/components/alert/readme.md +++ b/core/src/components/alert/readme.md @@ -613,8 +613,12 @@ Type: `Promise` | Name | Description | | -------------- | --------------------------- | | `--background` | Background of the alert | +| `--height` | Height of the alert | | `--max-height` | Maximum height of the alert | +| `--max-width` | Maximum width of the alert | +| `--min-height` | Minimum height of the alert | | `--min-width` | Minimum width of the alert | +| `--width` | Width of the alert | ---------------------------------------------- diff --git a/core/src/components/back-button/test/standalone/index.html b/core/src/components/back-button/test/standalone/index.html index ca75b67f0f..5ac1518253 100644 --- a/core/src/components/back-button/test/standalone/index.html +++ b/core/src/components/back-button/test/standalone/index.html @@ -102,8 +102,9 @@ } .wide { - --width: 200px; --background: lightblue; + + width: 200px; } .large { diff --git a/core/src/components/button/button.ios.scss b/core/src/components/button/button.ios.scss index 4fdf99a16d..fe755155ee 100644 --- a/core/src/components/button/button.ios.scss +++ b/core/src/components/button/button.ios.scss @@ -7,17 +7,16 @@ :host { --border-radius: #{$button-ios-border-radius}; - --margin-top: #{$button-ios-margin-top}; - --margin-bottom: #{$button-ios-margin-bottom}; - --margin-start: #{$button-ios-margin-start}; - --margin-end: #{$button-ios-margin-end}; --padding-top: #{$button-ios-padding-top}; --padding-bottom: #{$button-ios-padding-bottom}; --padding-start: #{$button-ios-padding-start}; --padding-end: #{$button-ios-padding-end}; - --height: #{$button-ios-height}; --transition: background-color, opacity 100ms linear; + @include margin($button-ios-margin-top, $button-ios-margin-end, $button-ios-margin-bottom, $button-ios-margin-start); + + height: #{$button-ios-height}; + font-size: #{$button-ios-font-size}; font-weight: #{$button-ios-font-weight}; @@ -89,7 +88,8 @@ --padding-start: #{$button-ios-large-padding-start}; --padding-end: #{$button-ios-large-padding-end}; --padding-bottom: #{$button-ios-large-padding-bottom}; - --height: #{$button-ios-large-height}; + + height: #{$button-ios-large-height}; font-size: #{$button-ios-large-font-size}; } @@ -100,7 +100,8 @@ --padding-start: #{$button-ios-small-padding-start}; --padding-end: #{$button-ios-small-padding-end}; --padding-bottom: #{$button-ios-small-padding-bottom}; - --height: #{$button-ios-small-height}; + + height: #{$button-ios-small-height}; font-size: #{$button-ios-small-font-size}; } diff --git a/core/src/components/button/button.md.scss b/core/src/components/button/button.md.scss index cbc821fefd..e4d37335ab 100644 --- a/core/src/components/button/button.md.scss +++ b/core/src/components/button/button.md.scss @@ -6,19 +6,18 @@ :host { --border-radius: #{$button-md-border-radius}; - --margin-top: #{$button-md-margin-top}; - --margin-bottom: #{$button-md-margin-bottom}; - --margin-start: #{$button-md-margin-start}; - --margin-end: #{$button-md-margin-end}; --padding-top: #{$button-md-padding-top}; --padding-bottom: #{$button-md-padding-bottom}; --padding-start: #{$button-md-padding-start}; --padding-end: #{$button-md-padding-end}; - --height: #{$button-md-height}; --transition: box-shadow 280ms cubic-bezier(.4, 0, .2, 1), background-color 15ms linear, color 15ms linear; + @include margin($button-md-margin-top, $button-md-margin-end, $button-md-margin-bottom, $button-md-margin-start); + + height: #{$button-md-height}; + font-size: #{$button-md-font-size}; font-weight: #{$button-md-font-weight}; @@ -88,7 +87,8 @@ --padding-start: #{$button-md-large-padding-start}; --padding-end: #{$button-md-large-padding-end}; --padding-bottom: #{$button-md-large-padding-bottom}; - --height: #{$button-md-large-height}; + + height: #{$button-md-large-height}; font-size: #{$button-md-large-font-size}; } @@ -98,7 +98,8 @@ --padding-start: #{$button-md-small-padding-start}; --padding-end: #{$button-md-small-padding-end}; --padding-bottom: #{$button-md-small-padding-bottom}; - --height: #{$button-md-small-height}; + + height: #{$button-md-small-height}; font-size: #{$button-md-small-font-size}; } diff --git a/core/src/components/button/button.scss b/core/src/components/button/button.scss index ef03bf27ac..a16aafab5a 100644 --- a/core/src/components/button/button.scss +++ b/core/src/components/button/button.scss @@ -13,9 +13,6 @@ * @prop --color-activated: Text color of the button when activated * @prop --color-focused: Text color of the button when focused * - * @prop --width: Width of the button - * @prop --height: Height of the button - * * @prop --transition: Transition of the button * * @prop --border-radius: Border radius of the button @@ -28,17 +25,11 @@ * @prop --box-shadow: Box shadow of the button * @prop --opacity: Opacity of the button * - * @prop --margin-top: Margin top of the button - * @prop --margin-end: Margin end of the button - * @prop --margin-bottom: Margin bottom of the button - * @prop --margin-start: Margin start of the button - * * @prop --padding-top: Padding top of the button * @prop --padding-end: Padding end of the button * @prop --padding-bottom: Padding bottom of the button * @prop --padding-start: Padding start of the button */ - --width: auto; --overflow: hidden; --ripple-color: currentColor; --border-width: initial; @@ -48,10 +39,11 @@ display: inline-block; + width: auto; + color: var(--color); font-family: $font-family-base; - pointer-events: auto; text-align: center; text-decoration: none; @@ -62,6 +54,7 @@ user-select: none; vertical-align: top; // the better option for most scenarios vertical-align: -webkit-baseline-middle; // the best for those that support it + pointer-events: auto; font-kerning: none; } @@ -199,15 +192,15 @@ .button-native { @include border-radius(var(--border-radius)); @include font-smoothing(); - @include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start)); + @include margin(0); @include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start)); @include text-inherit(); display: block; position: relative; - width: var(--width); - height: var(--height); + width: 100%; + height: 100%; transition: var(--transition); diff --git a/core/src/components/button/readme.md b/core/src/components/button/readme.md index 744276ce0a..40f6377b49 100644 --- a/core/src/components/button/readme.md +++ b/core/src/components/button/readme.md @@ -133,11 +133,6 @@ This attribute specifies the size of the button. Setting this attribute will cha | `--color` | Text color of the button | | `--color-activated` | Text color of the button when activated | | `--color-focused` | Text color of the button when focused | -| `--height` | Height of the button | -| `--margin-bottom` | Margin bottom of the button | -| `--margin-end` | Margin end of the button | -| `--margin-start` | Margin start of the button | -| `--margin-top` | Margin top of the button | | `--opacity` | Opacity of the button | | `--padding-bottom` | Padding bottom of the button | | `--padding-end` | Padding end of the button | @@ -145,7 +140,6 @@ This attribute specifies the size of the button. Setting this attribute will cha | `--padding-top` | Padding top of the button | | `--ripple-color` | Color of the button ripple effect | | `--transition` | Transition of the button | -| `--width` | Width of the button | ---------------------------------------------- diff --git a/core/src/components/button/test/standalone/index.html b/core/src/components/button/test/standalone/index.html index cd88b45820..4176cdc36b 100644 --- a/core/src/components/button/test/standalone/index.html +++ b/core/src/components/button/test/standalone/index.html @@ -71,7 +71,7 @@ + diff --git a/core/src/components/menu/usage/angular.md b/core/src/components/menu/usage/angular.md index e4a7386ff1..13c831ed24 100644 --- a/core/src/components/menu/usage/angular.md +++ b/core/src/components/menu/usage/angular.md @@ -1,10 +1,89 @@ ```html - + - - Menu + + Start Menu + + + Menu Item + Menu Item + Menu Item + Menu Item + Menu Item + + + + + + + Custom Menu + + + + + Menu Item + Menu Item + Menu Item + Menu Item + Menu Item + + + + + + + + End Menu + + + + + Menu Item + Menu Item + Menu Item + Menu Item + Menu Item + + + + ``` + +```typescript +import { Component } from '@angular/core'; +import { MenuController } from '@ionic/angular'; + +@Component({ + selector: 'menu-example', + templateUrl: 'menu-example.html', + styleUrls: ['./menu-example.css'], +}) +export class MenuExample { + +constructor(private menu: MenuController) { } + + openFirst() { + this.menu.enable(true, 'first'); + this.menu.open('first'); + } + + openEnd() { + this.menu.open('end'); + } + + openCustom() { + this.menu.enable(true, 'custom'); + this.menu.open('custom'); + } +} +``` + +```css +.my-custom-menu { + --width: 500px; +} +``` \ No newline at end of file diff --git a/core/src/components/menu/usage/javascript.md b/core/src/components/menu/usage/javascript.md index 0ba6db2ce3..fa232b1487 100644 --- a/core/src/components/menu/usage/javascript.md +++ b/core/src/components/menu/usage/javascript.md @@ -1,33 +1,93 @@ ```html - + - - Left Menu + + Start Menu - - - - - - Hola - - - - - hola macho + + + Menu Item + Menu Item + Menu Item + Menu Item + Menu Item + -