mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
refactor(buttons): button-native without prefix
Now we don't need prefix because of shadow-dom
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
// iOS Toolbar Default Button
|
// iOS Toolbar Default Button
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
::slotted(*) ion-button {
|
::slotted(*) ion-button.button {
|
||||||
--padding-top: 0;
|
--padding-top: 0;
|
||||||
--padding-bottom: 0;
|
--padding-bottom: 0;
|
||||||
--padding-start: 5px;
|
--padding-start: 5px;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Material Design Toolbar Default Button
|
// Material Design Toolbar Default Button
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
::slotted(*) ion-button {
|
::slotted(*) ion-button.button {
|
||||||
--padding-top: 0;
|
--padding-top: 0;
|
||||||
--padding-bottom: 0;
|
--padding-bottom: 0;
|
||||||
--padding-start: 8px;
|
--padding-start: 8px;
|
||||||
|
@ -39,17 +39,17 @@
|
|||||||
--color: #{ion-color(primary, contrast)};
|
--color: #{ion-color(primary, contrast)};
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(.chip-button-solid.ion-color) .chip-button-native {
|
:host(.chip-button-solid.ion-color) .button-native {
|
||||||
background: current-color(base);
|
background: current-color(base);
|
||||||
color: current-color(contrast);
|
color: current-color(contrast);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(.chip-button-clear.ion-color) .chip-button-native {
|
:host(.chip-button-clear.ion-color) .button-native {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: current-color(base);
|
color: current-color(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
.chip-button-native {
|
.button-native {
|
||||||
@include text-inherit();
|
@include text-inherit();
|
||||||
@include border-radius(var(--border-radius));
|
@include border-radius(var(--border-radius));
|
||||||
@include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start));
|
@include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start));
|
||||||
@ -68,7 +68,7 @@
|
|||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chip-button-inner {
|
.button-inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
|
@ -56,11 +56,11 @@ export class ChipButton implements ComponentInterface {
|
|||||||
return (
|
return (
|
||||||
<TagType
|
<TagType
|
||||||
type="button"
|
type="button"
|
||||||
class="chip-button-native"
|
class="button-native"
|
||||||
disabled={this.disabled}
|
disabled={this.disabled}
|
||||||
href={this.href}
|
href={this.href}
|
||||||
>
|
>
|
||||||
<span class="chip-button-inner">
|
<span class="button-inner">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</span>
|
</span>
|
||||||
{this.mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
{this.mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||||
|
@ -2,7 +2,7 @@ import { Component, ComponentInterface, Element, Event, EventEmitter, Method, Pr
|
|||||||
|
|
||||||
import { InputChangeEvent, Mode, PickerColumn, PickerColumnOption, PickerOptions, StyleEvent } from '../../interface';
|
import { InputChangeEvent, Mode, PickerColumn, PickerColumnOption, PickerOptions, StyleEvent } from '../../interface';
|
||||||
import { clamp, deferEvent } from '../../utils/helpers';
|
import { clamp, deferEvent } from '../../utils/helpers';
|
||||||
import { createThemedClasses, hostContext } from '../../utils/theme';
|
import { hostContext } from '../../utils/theme';
|
||||||
|
|
||||||
import { DatetimeData, LocaleData, convertFormatToKey, convertToArrayOfNumbers, convertToArrayOfStrings, dateDataSortValue, dateSortValue, dateValueRange, daysInMonth, getValueFromFormat, parseDate, parseTemplate, renderDatetime, renderTextFormat, updateDate } from './datetime-util';
|
import { DatetimeData, LocaleData, convertFormatToKey, convertToArrayOfNumbers, convertToArrayOfStrings, dateDataSortValue, dateSortValue, dateValueRange, daysInMonth, getValueFromFormat, parseDate, parseTemplate, renderDatetime, renderTextFormat, updateDate } from './datetime-util';
|
||||||
|
|
||||||
@ -507,7 +507,6 @@ export class Datetime implements ComponentInterface {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
class: {
|
class: {
|
||||||
...createThemedClasses(this.mode, 'datetime'),
|
|
||||||
'datetime-disabled': this.disabled,
|
'datetime-disabled': this.disabled,
|
||||||
'datetime-placeholder': addPlaceholderClass,
|
'datetime-placeholder': addPlaceholderClass,
|
||||||
'in-item': hostContext('ion-item', this.el)
|
'in-item': hostContext('ion-item', this.el)
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
::slotted(ion-icon),
|
::slotted(ion-icon),
|
||||||
.fab-button-close-icon {
|
.close-icon {
|
||||||
font-size: $fab-ios-icon-font-size;
|
font-size: $fab-ios-icon-font-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
::slotted(ion-icon),
|
::slotted(ion-icon),
|
||||||
.fab-button-close-icon {
|
.close-icon {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
--background: #{current-color(tint)};
|
--background: #{current-color(tint)};
|
||||||
}
|
}
|
||||||
|
|
||||||
.fab-button-native {
|
.button-native {
|
||||||
@include text-inherit();
|
@include text-inherit();
|
||||||
@include border-radius(50%);
|
@include border-radius(50%);
|
||||||
@include margin(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
@include margin(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
||||||
@ -69,7 +69,7 @@
|
|||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fab-button-native[disabled] {
|
.button-native[disabled] {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@ -79,7 +79,7 @@
|
|||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fab-button-inner {
|
.button-inner {
|
||||||
@include position(0, 0, null, 0);
|
@include position(0, 0, null, 0);
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -107,7 +107,7 @@
|
|||||||
// FAB Close Icon
|
// FAB Close Icon
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
.fab-button-close-icon {
|
.close-icon {
|
||||||
@include position(0, 0, null, 0);
|
@include position(0, 0, null, 0);
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -129,13 +129,13 @@
|
|||||||
// FAB Animation
|
// FAB Animation
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
:host(.fab-button-close-active) .fab-button-close-icon {
|
:host(.fab-button-close-active) .close-icon {
|
||||||
transform: scale(1) rotateZ(0deg);
|
transform: scale(1) rotateZ(0deg);
|
||||||
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(.fab-button-close-active) .fab-button-inner {
|
:host(.fab-button-close-active) .button-inner {
|
||||||
transform: scale(.4) rotateZ(45deg);
|
transform: scale(.4) rotateZ(45deg);
|
||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
@ -83,15 +83,15 @@ export class FabButton implements ComponentInterface {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TagType
|
<TagType
|
||||||
class="fab-button-native"
|
class="button-native"
|
||||||
disabled={this.disabled}
|
disabled={this.disabled}
|
||||||
href={this.href}
|
href={this.href}
|
||||||
onClick={ev => openURL(this.win, this.href, ev, this.routerDirection)}
|
onClick={ev => openURL(this.win, this.href, ev, this.routerDirection)}
|
||||||
>
|
>
|
||||||
<span class="fab-button-close-icon">
|
<span class="close-icon">
|
||||||
<ion-icon name="close" lazy={false}></ion-icon>
|
<ion-icon name="close" lazy={false}></ion-icon>
|
||||||
</span>
|
</span>
|
||||||
<span class="fab-button-inner">
|
<span class="button-inner">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</span>
|
</span>
|
||||||
{this.mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
{this.mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
color: current-color(contrast);
|
color: current-color(contrast);
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-option-native {
|
.button-native {
|
||||||
@include text-inherit();
|
@include text-inherit();
|
||||||
@include padding(0, .7em);
|
@include padding(0, .7em);
|
||||||
|
|
||||||
@ -41,7 +41,7 @@
|
|||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-option-button-inner {
|
.button-inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -65,12 +65,12 @@ export class ItemOption implements ComponentInterface {
|
|||||||
return (
|
return (
|
||||||
<TagType
|
<TagType
|
||||||
type="button"
|
type="button"
|
||||||
class="item-option-native"
|
class="button-native"
|
||||||
disabled={this.disabled}
|
disabled={this.disabled}
|
||||||
href={this.href}
|
href={this.href}
|
||||||
onClick={this.clickedOptionButton.bind(this)}
|
onClick={this.clickedOptionButton.bind(this)}
|
||||||
>
|
>
|
||||||
<span class="item-option-button-inner">
|
<span class="button-inner">
|
||||||
<slot name="start"></slot>
|
<slot name="start"></slot>
|
||||||
<slot name="top" />
|
<slot name="top" />
|
||||||
<slot name="icon-only" />
|
<slot name="icon-only" />
|
||||||
|
@ -40,23 +40,23 @@
|
|||||||
font-kerning: none;
|
font-kerning: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(:first-of-type) .segment-button-native {
|
:host(:first-of-type) .button-native {
|
||||||
--padding-end: 0;
|
--padding-end: 0;
|
||||||
|
|
||||||
@include border-radius(var(--border-radius), 0, 0, var(--border-radius));
|
@include border-radius(var(--border-radius), 0, 0, var(--border-radius));
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(:not(:first-of-type)) .segment-button-native {
|
:host(:not(:first-of-type)) .button-native {
|
||||||
border-left-width: 0;
|
border-left-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(:last-of-type) .segment-button-native {
|
:host(:last-of-type) .button-native {
|
||||||
--padding-start: 0;
|
--padding-start: 0;
|
||||||
|
|
||||||
@include border-radius(0, var(--border-radius), var(--border-radius), 0);
|
@include border-radius(0, var(--border-radius), var(--border-radius), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.segment-button-native {
|
.button-native {
|
||||||
@include text-inherit();
|
@include text-inherit();
|
||||||
@include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start));
|
@include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start));
|
||||||
@include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
@include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
||||||
@ -73,16 +73,13 @@
|
|||||||
border-style: var(--border-style);
|
border-style: var(--border-style);
|
||||||
border-color: var(--btn-border-color);
|
border-color: var(--btn-border-color);
|
||||||
|
|
||||||
|
outline: none;
|
||||||
|
|
||||||
background: var(--btn-background);
|
background: var(--btn-background);
|
||||||
|
|
||||||
contain: content;
|
contain: content;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&:active,
|
|
||||||
&:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::slotted(ion-icon) {
|
::slotted(ion-icon) {
|
||||||
|
@ -71,7 +71,7 @@ export class SegmentButton implements ComponentInterface {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
aria-pressed={this.checked ? 'true' : null}
|
aria-pressed={this.checked ? 'true' : null}
|
||||||
class="segment-button-native"
|
class="button-native"
|
||||||
disabled={this.disabled}
|
disabled={this.disabled}
|
||||||
onClick={() => this.checked = true}
|
onClick={() => this.checked = true}
|
||||||
>
|
>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component, ComponentInterface, Listen, Prop } from '@stencil/core';
|
import { Component, ComponentInterface, Listen, Prop } from '@stencil/core';
|
||||||
|
|
||||||
import { Mode, SelectPopoverOption } from '../../interface';
|
import { Mode, SelectPopoverOption } from '../../interface';
|
||||||
import { createThemedClasses } from '../../utils/theme';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
tag: 'ion-select-popover',
|
tag: 'ion-select-popover',
|
||||||
@ -32,12 +31,6 @@ export class SelectPopover implements ComponentInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hostData() {
|
|
||||||
return {
|
|
||||||
class: createThemedClasses(this.mode, 'select-popover')
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
Reference in New Issue
Block a user