Browse Source

Task/improve style of toggle component (#7655)

* Improve style

* Update changelog
pull/7661/head
Thomas Kaul 15 hours ago
committed by GitHub
parent
commit
b50349a385
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      libs/ui/src/lib/toggle/toggle.component.html
  3. 79
      libs/ui/src/lib/toggle/toggle.component.scss

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the style of the toggle component
- Moved the improved symbol lookup results by removing the currency from the name of cryptocurrencies from experimental to general availability - Moved the improved symbol lookup results by removing the currency from the name of cryptocurrencies from experimental to general availability
- Upgraded `ng-extract-i18n-merge` from `3.3.0` to `3.4.0` - Upgraded `ng-extract-i18n-merge` from `3.3.0` to `3.4.0`

2
libs/ui/src/lib/toggle/toggle.component.html

@ -1,5 +1,5 @@
<mat-radio-group <mat-radio-group
class="d-block text-nowrap" class="d-inline-flex text-nowrap"
[formControl]="optionFormControl" [formControl]="optionFormControl"
(change)="onValueChange()" (change)="onValueChange()"
> >

79
libs/ui/src/lib/toggle/toggle.component.scss

@ -1,55 +1,70 @@
:host { :host {
display: block; display: block;
.mat-mdc-radio-button { .mat-mdc-radio-group {
border-radius: 1rem; border: 1px solid rgba(var(--dark-dividers));
margin: 0 0.25rem; border-radius: 1.15rem;
padding: 0.15rem;
&.mat-mdc-radio-checked { .mat-mdc-radio-button {
background-color: rgba(var(--dark-dividers)); border-radius: 1rem;
}
&.mat-mdc-radio-disabled { &.mat-mdc-radio-checked {
::ng-deep { background-color: rgba(var(--dark-dividers));
label { }
color: rgba(var(--dark-disabled-text));
&.mat-mdc-radio-disabled {
::ng-deep {
label {
color: rgba(var(--dark-disabled-text));
}
} }
} }
}
::ng-deep { ion-icon {
.mdc-radio { height: var(
display: none; --mat-radio-label-text-line-height,
var(--mat-sys-body-medium-line-height)
);
} }
label { ::ng-deep {
color: rgba(var(--dark-primary-text), 1); .mdc-radio {
cursor: inherit; display: none;
margin: 0; }
padding: 0.15rem 0.75rem;
label {
color: rgba(var(--dark-primary-text), 1);
cursor: inherit;
margin: 0;
padding: 0.15rem 0.75rem;
}
} }
} }
} }
} }
:host-context(.theme-dark) { :host-context(.theme-dark) {
.mat-mdc-radio-button { .mat-mdc-radio-group {
&.mat-mdc-radio-checked { border-color: rgba(var(--light-dividers));
background-color: rgba(var(--light-dividers));
border: 1px solid rgba(var(--light-disabled-text));
}
&.mat-mdc-radio-disabled { .mat-mdc-radio-button {
::ng-deep { &.mat-mdc-radio-checked {
label { background-color: rgb(var(--palette-background-unselected-chip-dark));
color: rgba(var(--light-disabled-text)); }
&.mat-mdc-radio-disabled {
::ng-deep {
label {
color: rgba(var(--light-disabled-text));
}
} }
} }
}
::ng-deep { ::ng-deep {
label { label {
color: rgba(var(--light-primary-text), 1); color: rgba(var(--light-primary-text), 1);
}
} }
} }
} }

Loading…
Cancel
Save