43 Commits

Author SHA1 Message Date
666a01dd6e fix(button): wrap text by default (#28682)
Issue number: resolves #8700

BREAKING CHANGE: Button text now wraps by default.
2023-12-12 13:15:13 -05:00
6fe716fd13 feat(button): allow button to increase in height when text wraps (#27547)
Issue number: N/A - this does not completely resolve an issue but it
enables users to opt-in to having text wrap in a button by setting a
minimum height

---------

## What is the current behavior?
The current behavior when text is really long in a button is:
- Default buttons expand in width until part of the text (and button) is
off the screen and not in the visible viewport
- Block and full buttons horizontally align the text in the center and
overflow it on both sides (but the overflow is not visible so the text
is cut off at the beginning and end)

## What is the new behavior?
Allow the button height to increase when text wraps and add some padding
so that buttons with wrapped text still look nice. This does **NOT**
wrap the text in a button by default. That will be done in FW-4599.

- Removed `text-overflow: ellipsis` since this does not have any effect
- Changes `height` setting to `min-height` on all button types (small,
large, default) and buttons inside of an item, toolbar or list header
- Increases `padding-top` and `padding-bottom` on the buttons so that
overflowing buttons have padding around them
- Changes `.button-native` display property from `block` to `flex` in
order for anchor tags (`<ion-button href="#">` to align their text
vertically
- Sets `flex-shrink: 0` on slotted `start`/`end` elements to prevent
icons (and other elements) from shrinking to make room for the text
- Adds e2e test for button wrapping including the different types of
buttons that were changed by this PR
- Adds `ion-text-wrap` to the `ion-button` elements used in this test to
verify the height / padding changes are working as desired (to be
removed with FW-4599)
- Screenshot diffs are in the following PR:
https://github.com/ionic-team/ionic-framework/pull/27561

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

This does **NOT** wrap the text in a button by default. It only enables
buttons to look nicer and auto adjust their height/padding when the text
is wrapping.

After internal discussion we decided that automatically making the text
wrap inside of a button may have undesired effects on existing apps. For
example, if someone has a button inside of a list header with a long
label, the button will now wrap if it has a space or dash in the text
content.

Developers should set `ion-text-wrap` on the `ion-button` to opt-in to
text wrapping in a button, and this will become the default as part of
FW-4599 (the next major release).

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-07-07 15:04:52 -04:00
67815ccbf4 fix(button): show correct activated state for ios (#26900)
fixes #22468
2023-03-07 13:00:37 -05:00
3b803ebe02 fix(button): buttons are now disabled during page transitions (#23589)
resolves #23588
2021-07-09 09:27:11 -04:00
7ecde36f9d fix(button): allow overflow to be overridden by the CSS variable (#20738)
fixes #20726
2020-03-11 11:35:26 -04:00
c1d7bf229d fix(buttons): use proper button colors based on CSS variables when inside of a toolbar (#20633) 2020-02-27 16:22:39 -05:00
94159291b2 feat(components): improve button states and add new css properties (#19440)
Before users had to know the exact opacity that the MD/iOS spec called for in order to change the hover or focused background color. This allows them to change the background without having to know the opacity. 

- changes apply to Action Sheet (Buttons), Back Button, Button, FAB Button, Item, Menu Button, Segment Button, Tab Button
- greatly reduces the requirement by users to set the background hover, focused states for dark modes and custom themes, also eliminates the need to know what the hover opacity is for each based on the spec
- updates the MD dark theme per their spec
- adds a component guide for internal use changing Ionic components

references #18279 fixes #20213 fixes #19965

BREAKING CHANGE:

*Activated Class*

The `activated` class that is automatically added to buttons on press has been renamed to `ion-activated`. This will be more consistent with our `ion-focused` class we add and also will reduce conflicts with user's CSS.

*CSS Variables*

The `--background-hover`, `--background-focused` and `--background-activated` CSS variables on components that render native buttons will now have an opacity automatically set. If you are setting any of these like the following:

```
--background-hover: rgba(44, 44, 44, 0.08);
```

You will likely not see a hover state anymore. It should be updated to only set the desired color:

```
--background-hover: rgba(44, 44, 44);
```

If the opacity desired is something other than what the spec asks for, use:

```
--background-hover: rgba(44, 44, 44);
--background-hover-opacity: 1;
```
2020-01-23 16:57:47 -05:00
f48dc3dd1a fix(button): default opacity for disabled clear buttons (#18560)
fixes #18555
2019-06-26 12:29:24 -04:00
73599c22aa docs(components): document what start and end mean for CSS variables (#18538) 2019-06-21 15:11:07 -04:00
26ecf2b10f fix(button): update solid buttons to use tint and shade colors (#18537) 2019-06-21 11:31:41 -04:00
320719b904 fix(button): set opacity on the host for disabled button (#18509)
allows for customization of the disabled button opacity

fixes #16965
2019-06-11 17:56:13 -04:00
58672fb221 feat(back-button): add variables and support for focused and hover states (#18451)
- updates MD spacing for back button text
- also adds e2e tests and adds them to screenshot

references #18279 references #17624 fixes #18465
2019-06-10 15:23:42 -04:00
5c5934bc24 feat(button): add variables for customizing hover state (#18499)
resolves #17974
2019-06-10 13:38:50 -04:00
3defbf3a8f fix(button): avoid using attribute selectors for disabled (#17198) 2019-01-22 14:23:30 +01:00
0120eee8d4 fix(inputs): fix styles in firefox (#17066) 2019-01-11 20:28:56 +01:00
6364e4e2a1 fix(inputs): keyboard focus improvements (#16838)
fixes #16815
fixes #16872
fixes #13978
fixes #16610
2019-01-11 19:36:02 +01:00
4053f386fd refactor(components): consistent css variables for size (#16600)
Reviews the `--width` and `--height` variables in each component to either remove or add them based on need.

- fixes a bug where the spinner color wasn't being set properly in loading
- adds css variables for customizing background, color, some borders in overlays
- fixes a bug where prefix, suffix are taking up too much width in picker

closes #16097
references ionic-team/ionic-docs#228

BREAKING CHANGES

## Core Components

Removes the `--width` and `--height` variables from the following components, in favor of CSS:

- Button
- FAB Button
- Checkbox
  - Removes the `--width`/`--height` and adds a `--size` variable that is set on the width and height, allowing width and height to still be set and border-radius to still use it as a variable
- Radio
  - Removes the `--width`/`--height` and `--inner-width`/`--inner-height` variables. Calculates inner values based on parent element size.

## Overlay Components

The following components have all be converted to shadow (or scoped) and have CSS variables for width/height:

- Action Sheet _(scoped)_
- Alert  _(scoped)_
- Loading  _(scoped)_
- Menu _(shadow)_
- Modal  _(scoped)_
- Picker _(scoped)_
- Popover  _(scoped)_
- Toast _(shadow)_

The above components will now have the following CSS variables for consistency among overlays:

| Name              |
| ----------------- |
| `--height`        |
| `--max-height`    |
| `--max-width`     |
| `--min-height`    |
| `--min-width`     |
| `--width`         |

If the component does not set the value, it will default to `auto`.

## Removed CSS Variables

The following CSS properties have been removed:

| Component      | Property            | Reason                          |
| ---------------| --------------------| --------------------------------|
| **Button**     | `--height`          | Use CSS instead                 |
| **Button**     | `--margin-bottom`   | Use CSS instead                 |
| **Button**     | `--margin-end`      | Use CSS instead                 |
| **Button**     | `--margin-start`    | Use CSS instead                 |
| **Button**     | `--margin-top`      | Use CSS instead                 |
| **Button**     | `--width`           | Use CSS instead                 |
| **Checkbox**   | `--height`          | Use CSS or `--size`             |
| **Checkbox**   | `--width`           | Use CSS or `--size`             |
| **FAB Button** | `--width`           | Use CSS instead                 |
| **FAB Button** | `--height`          | Use CSS instead                 |
| **FAB Button** | `--margin-bottom`   | Use CSS instead                 |
| **FAB Button** | `--margin-end`      | Use CSS instead                 |
| **FAB Button** | `--margin-start`    | Use CSS instead                 |
| **FAB Button** | `--margin-top       | Use CSS instead                 |
| **Menu**       | `--width-small`     | Use a media query and `--width` |
| **Radio**      | `--width`           | Use CSS instead                 |
| **Radio**      | `--height`          | Use CSS instead                 |
| **Radio**      | `--inner-height`    | Calculated based on parent      |
| **Radio**      | `--inner-width`     | Calculated based on parent      |
2018-12-14 15:45:14 -05:00
1a299b01fe feat(toast): add CSS variables for box-shadow and border (#16679)
* feat(toast): add border and box-shadow CSS variable

* feat(toast): add new CSS vars
2018-12-11 13:29:42 +01:00
235c6859d2 feat(modal): add css vars (#16605)
* feat(modal): add css vars

* add more css vars

* add docs

* add background

* fix e2e test
2018-12-06 15:36:09 +01:00
802a3d14e7 fix(button): relax css containment to "content" (#16553) 2018-12-02 13:01:03 +01:00
2884076834 feat(ripple): adds unbounded ripple-effect (#16399) 2018-11-20 23:37:54 +01:00
6d5944613a fix(ripple-effect): follow MD spec (#16330)
* fix(ripple-effect): follow md spec

* add box-shadow back

* add ripple effect to alert and action-sheet
2018-11-15 16:08:39 +01:00
e189cc6ec2 fix(button): use class instead of reflect
fixes #15623
2018-10-08 16:05:59 -05:00
bac49ca71b fix(button): default button width to auto to avoid inheriting
fixes #15522
2018-09-19 16:50:24 -04:00
d145cae801 fix(button): disable pointer events in toolbar buttons
Closes #15623
2018-09-18 14:57:56 -04:00
b8b9b83d49 fix(button): vanilla color is usable 2018-09-14 22:57:12 +02:00
3af43610bb fix(button): add custom properties and remove --ion-color overrides (#15463)
- adds custom properties 
- removes the overrides of `--ion-color-*` variables
- documents the properties

references #14808 references #14853 references #14850
2018-09-05 12:23:47 -04:00
d12ef78de6 refactor(all): cleanup mode font 2018-08-24 03:33:44 +02:00
359c47f7b8 fix(buttons): margin between buttons 2018-08-20 19:01:33 +02:00
6e3e07bc8b fix(all): improve text customization 2018-08-10 00:36:07 +02:00
a77ee2a6f8 fix(sliding): fix core gesture logic + priority configuration
fixes #14763
2018-08-07 17:14:04 +02:00
49cac8beec perf(gesture): lazy loaded dynamic ES module 2018-08-01 05:08:39 +02:00
8a1ad1da2c fix(app): user-select on desktop 2018-07-29 14:48:05 +02:00
25423a06f2 fix(button): improve text style inherency
related #14927
2018-07-29 13:19:28 +02:00
ddb1e4989a feat(button): overflow is configurable
fixes #14839
2018-07-24 02:09:56 +02:00
7a8d5f68d2 chore(stylelint): remove sass-lint/scss-lint in favor of stylelint
- remove scss-lint and sass-lint
- add stylelint and stylelint-order packages and configuration
- update all *.scss files to new syntax

fixes #14805
2018-07-19 15:10:30 -05:00
094fde755c style(css): fix most scss lint errors 2018-07-18 12:53:33 -04:00
89d1526708 fix(button): set display type on host 2018-07-16 13:20:10 -05:00
9c9f081970 fix(button): add box-sizing so anchor buttons won't exceed max-width
fixes #14760
2018-07-12 17:24:33 -04:00
6b29507f0e style(components): consistent line breaks with mixin args 2018-07-10 16:13:52 -04:00
a7f1f4daa7 refactor(components): update to use shadow DOM and work with css variables
- updates components to use shadow DOM or scoped if they require css variables
- moves global styles to an external stylesheet that needs to be imported
- adds support for additional colors and removes the Sass loops to generate colors for each component
- several property renames, bug fixes, and test updates

Co-authored-by: Manu Mtz.-Almeida <manu.mtza@gmail.com>
Co-authored-by: Adam Bradley <adambradley25@gmail.com>
Co-authored-by: Cam Wiegert <cam@camwiegert.com>
2018-07-09 12:57:21 -04:00
88752dea51 style(sass): move font smooth to mixin and remove webkit properties
autoprefixer is adding the backdrop-filter for us now
2018-03-28 18:24:04 -04:00
d37623a2ca chore(packages): move the packages to root 2018-03-12 16:02:25 -04:00