diff --git a/core/src/components/toolbar/readme.md b/core/src/components/toolbar/readme.md index c7acecd4ec..26297e52be 100644 --- a/core/src/components/toolbar/readme.md +++ b/core/src/components/toolbar/readme.md @@ -62,6 +62,22 @@ The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`. +## CSS Custom Properties + +| Name | Description | +| ------------------ | --------------------------------- | +| `--background` | Background of the toolbar | +| `--border-color` | Color of the toolbar border | +| `--border-style` | Style of the toolbar border | +| `--border-width` | Width of the toolbar border | +| `--color` | Color of the toolbar text | +| `--min-height` | Minimum height of the toolbar | +| `--opacity` | Opacity of the toolbar background | +| `--padding-bottom` | Bottom padding of the toolbar | +| `--padding-end` | End padding of the toolbar | +| `--padding-start` | Start padding of the toolbar | +| `--padding-top` | Top padding of the toolbar | + ---------------------------------------------- diff --git a/core/src/components/toolbar/test/standalone/index.html b/core/src/components/toolbar/test/standalone/index.html index 17e191e04e..4aefa3433d 100644 --- a/core/src/components/toolbar/test/standalone/index.html +++ b/core/src/components/toolbar/test/standalone/index.html @@ -49,11 +49,20 @@ Dark + + + Custom + diff --git a/core/src/components/toolbar/toolbar.ios.scss b/core/src/components/toolbar/toolbar.ios.scss index 8375ff8886..3391a33cd9 100644 --- a/core/src/components/toolbar/toolbar.ios.scss +++ b/core/src/components/toolbar/toolbar.ios.scss @@ -5,10 +5,9 @@ // -------------------------------------------------- :host { - --ion-color-base: #{$toolbar-ios-background-color}; - --ion-color-contrast: #{$toolbar-ios-text-color}; + --background: #{$toolbar-ios-background-color}; + --color: #{$toolbar-ios-text-color}; --border-color: #{$toolbar-ios-border-color}; - --translucent-filter: #{$toolbar-ios-translucent-filter}; --padding-top: #{$toolbar-ios-padding}; --padding-bottom: #{$toolbar-ios-padding}; --padding-start: #{$toolbar-ios-padding}; diff --git a/core/src/components/toolbar/toolbar.ios.vars.scss b/core/src/components/toolbar/toolbar.ios.vars.scss index afb42ded43..e4d1806808 100644 --- a/core/src/components/toolbar/toolbar.ios.vars.scss +++ b/core/src/components/toolbar/toolbar.ios.vars.scss @@ -36,9 +36,6 @@ $toolbar-ios-button-strong-font-weight: 600 !default; /// @prop - Fill color of the toolbar button icon $toolbar-ios-button-icon-fill-color: currentColor !default; -/// @prop - Filter of the translucent toolbar -$toolbar-ios-translucent-filter: saturate(180%) blur(20px) !default; - // iOS Title // -------------------------------------------------- diff --git a/core/src/components/toolbar/toolbar.md.scss b/core/src/components/toolbar/toolbar.md.scss index 2422c6832b..2e46fa4e45 100644 --- a/core/src/components/toolbar/toolbar.md.scss +++ b/core/src/components/toolbar/toolbar.md.scss @@ -5,8 +5,8 @@ // -------------------------------------------------- :host { - --ion-color-base: #{$toolbar-md-background-color}; - --ion-color-contrast: #{$toolbar-md-text-color}; + --background: #{$toolbar-md-background-color}; + --color: #{$toolbar-md-text-color}; --border-color: #{$toolbar-md-border-color}; --padding-top: #{$toolbar-md-padding}; --padding-bottom: #{$toolbar-md-padding}; @@ -14,7 +14,7 @@ --padding-end: #{$toolbar-md-padding}; --min-height: #{$toolbar-md-height}; - font-family: #{$toolbar-md-font-family}; + font-family: $toolbar-md-font-family; } diff --git a/core/src/components/toolbar/toolbar.scss b/core/src/components/toolbar/toolbar.scss index cf26a8c6cb..a4003222c0 100644 --- a/core/src/components/toolbar/toolbar.scss +++ b/core/src/components/toolbar/toolbar.scss @@ -4,9 +4,21 @@ // -------------------------------------------------- :host { + /** + * @prop --background: Background of the toolbar + * @prop --border-color: Color of the toolbar border + * @prop --border-style: Style of the toolbar border + * @prop --border-width: Width of the toolbar border + * @prop --color: Color of the toolbar text + * @prop --min-height: Minimum height of the toolbar + * @prop --opacity: Opacity of the toolbar background + * @prop --padding-bottom: Bottom padding of the toolbar + * @prop --padding-end: End padding of the toolbar + * @prop --padding-start: Start padding of the toolbar + * @prop --padding-top: Top padding of the toolbar + */ --border-width: 0; --border-style: solid; - --background: #{current-color(base)}; --opacity: 1; @include font-smoothing(); @@ -15,7 +27,7 @@ width: 100%; - color: #{current-color(contrast)}; + color: var(--color); contain: content; @@ -23,6 +35,14 @@ box-sizing: border-box; } +:host(.ion-color) { + color: current-color(contrast); +} + +:host(.ion-color) .toolbar-background { + background: current-color(base); +} + .toolbar-container { @include padding( var(--padding-top),