Files
ionic-framework/core/src/components/chip/chip.ionic.scss
Sean Perkins 62a3e115ef chore(ci): stability for test-core-clean-build (#29338)
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

CI will fail randomly due to which stylesheet is processed last by
rollup in Stencil. This leads to random failures.

This is caused by some of the new ionic stylesheets not importing the
same common stylesheet that included the CSS variable documentation.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Temporarily copies and pastes the documentation blocks to the affected
ionic stylesheets
- CI should no longer fail randomly when comparing the generated
`api.txt` output
- Adds a technical debt track to track removing these changes once the
bug in Stencil is resolved and released

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
2024-04-12 16:18:15 -04:00

111 lines
2.7 KiB
SCSS

@use "../../themes/ionic.mixins" as mixins;
@use "../../foundations/ionic.vars.scss" as tokens;
// Ionic Chip
// --------------------------------------------------
// TODO(ROU-4870): there is no token yet for these ones, but it should be created in the future, once UX team has figma tokens done
$ionic-states-focus-primary: #9ec4fd;
$ionic-states-hover: #{rgba(#05080f, 0.16)}; // We should review how to make this in the future, as we are setting scss variables with a var() and fallback, and it doesn't work inside a rgba().
:host {
// TODO(FW-6178): Remove this once the Stencil bug is resolved.
/**
* @prop --background: Background of the chip
* @prop --color: Color of the chip
*/
--background: #{tokens.$ionic-color-neutral-10};
--border-color: transparent;
--border-radius: #{tokens.$ionic-border-radius-rounded-small};
--color: #{tokens.$ionic-color-neutral-900};
--focus-ring-color: #{$ionic-states-focus-primary};
--focus-ring-width: #{tokens.$ionic-border-size-medium};
@include mixins.font-smoothing;
@include mixins.padding(tokens.$ionic-space-xs, tokens.$ionic-space-xxs);
@include mixins.border-radius(var(--border-radius));
display: inline-flex;
position: relative;
align-items: center;
justify-content: center;
gap: tokens.$ionic-space-xxxs;
min-height: 32px;
border-width: tokens.$ionic-border-size-small;
border-style: solid;
border-color: var(--border-color);
background: var(--background);
color: var(--color);
font-family: tokens.$ionic-font-family;
font-size: tokens.$ionic-font-size-m;
font-weight: tokens.$ionic-font-weight-medium;
line-height: tokens.$ionic-font-line-height-full;
cursor: pointer;
overflow: hidden;
box-sizing: border-box;
vertical-align: middle;
}
// Outline Chip
// ---------------------------------------------
:host(.chip-outline) {
--background: transparent;
border-color: tokens.$ionic-color-neutral-100;
}
// Chip: Focus
// ---------------------------------------------
:host(.ion-focused) {
outline: var(--focus-ring-width) solid var(--focus-ring-color);
outline-offset: var(--focus-ring-width);
}
// Chip: Hover
// ---------------------------------------------
@media (any-hover: hover) {
:host(:hover) {
--background: #{$ionic-states-hover};
}
}
// Chip: Disabled
// ---------------------------------------------
:host(.chip-disabled) {
opacity: 0.6;
pointer-events: none;
}
// Chip Shapes
// ---------------------------------------------
:host(.chip-round) {
--border-radius: #{tokens.$ionic-border-radius-rounded-large};
}
:host(.chip-rectangular) {
--border-radius: #{tokens.$ionic-border-radius-square};
}
// Chip Icon
// ---------------------------------------------
::slotted(ion-icon) {
font-size: tokens.$ionic-font-size-l;
}