Skip to content

Commit

Permalink
feat(design)!: remove color property from DaffPaginatorComponent (#…
Browse files Browse the repository at this point in the history
…2873)

BREAKING CHANGE: The `color` property has been removed from the codebase. Paginators are no longer themable.
  • Loading branch information
xelaint committed Jun 14, 2024
1 parent 31b2555 commit 5c91c6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 73 deletions.
55 changes: 0 additions & 55 deletions libs/design/paginator/src/paginator-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
@use '../../scss/core';
@use '../../scss/theming';

@mixin daff-paginator-theme-variant($active-color) {
color: currentColor;

&:hover,
&.selected { /* stylelint-disable-line selector-class-pattern */
color: theming.daff-text-contrast($active-color);

&:after {
background: $active-color;
}
}
}

@mixin daff-paginator-theme($theme) {
$primary: map.get($theme, primary);
$secondary: map.get($theme, secondary);
Expand Down Expand Up @@ -44,47 +31,5 @@
}
}
}

&.daff-primary {
.daff-paginator__page-link {
@include daff-paginator-theme-variant(theming.daff-color($primary));
}
}

&.daff-secondary {
.daff-paginator__page-link {
@include daff-paginator-theme-variant(theming.daff-color($secondary));
}
}

&.daff-tertiary {
.daff-paginator__page-link {
@include daff-paginator-theme-variant(theming.daff-color($tertiary));
}
}

&.daff-theme {
.daff-paginator__page-link {
@include daff-paginator-theme-variant($base);
}
}

&.daff-theme-contrast {
.daff-paginator__page-link {
@include daff-paginator-theme-variant($base-contrast);
}
}

&.daff-black {
.daff-paginator__page-link {
@include daff-paginator-theme-variant($black);
}
}

&.daff-white {
.daff-paginator__page-link {
@include daff-paginator-theme-variant($white);
}
}
}
}
20 changes: 2 additions & 18 deletions libs/design/paginator/src/paginator/paginator.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ import {
DaffPaginatorPageOutOfRangeErrorMessage,
} from '../utils/paginator-errors';

/**
* An _elementRef and an instance of renderer2 are needed for the Colorable mixin
*/
class DaffPaginatorBase {
constructor(public _elementRef: ElementRef, public _renderer: Renderer2) {}
}

/**
* @deprecated in v1.0.0
*/
const _daffPaginatorBase = daffColorMixin(DaffPaginatorBase);

const visiblePageRange = 2;

/**
Expand All @@ -46,12 +34,9 @@ const visiblePageRange = 2;
selector: 'daff-paginator',
styleUrls: ['./paginator.component.scss'],
templateUrl: './paginator.component.html',
//todo(damienwebdev): remove once decorators hit stage 3 - https://github.com/microsoft/TypeScript/issues/7342
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['color'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DaffPaginatorComponent extends _daffPaginatorBase implements OnChanges, DaffColorable {
export class DaffPaginatorComponent implements OnChanges {

/**
* @docs-private
Expand All @@ -76,8 +61,7 @@ export class DaffPaginatorComponent extends _daffPaginatorBase implements OnChan
*/
_paginatorId: string;

constructor(private elementRef: ElementRef, private renderer: Renderer2) {
super(elementRef, renderer);
constructor(private elementRef: ElementRef) {
const ariaLabel = elementRef.nativeElement.attributes['aria-label'];
this._paginatorId = ariaLabel ? ariaLabel.nodeValue : null;
}
Expand Down

0 comments on commit 5c91c6e

Please sign in to comment.