Skip to content

Commit

Permalink
feat(design): remove default color on loading icon and update styles (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xelaint committed Jul 6, 2023
1 parent 56f37a4 commit 2649337
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions libs/design/src/atoms/loading-icon/loading-icon-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
$black: core.daff-map-deep-get($theme, 'core.black');

.daff-loading-icon {
circle {
stroke: currentColor;
}

&.daff-primary {
circle {
stroke: theming.daff-color($primary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ $max-stroke-length: $perimeter * $max-percentage-fill;
$angle: 270 - $max-percentage-fill * 360;

:host {
display: block;
display: flex;
width: 100%;
}

circle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ describe('DaffLoadingIconComponent | Usage', () => {
});
});


describe('DaffLoadingIconComponent | Defaults', () => {
let component: DaffLoadingIconComponent;
let fixture: ComponentFixture<DaffLoadingIconComponent>;
Expand Down Expand Up @@ -101,8 +100,8 @@ describe('DaffLoadingIconComponent | Defaults', () => {
expect(component.diameter).toEqual(60);
});

it('should set the default color to primary', () => {
expect(component.color).toEqual('primary');
it('should not set a default color', () => {
expect(component.color).toBeFalsy();
});
});

Expand Down
6 changes: 2 additions & 4 deletions libs/design/src/atoms/loading-icon/loading-icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import {
daffColorMixin,
DaffColorable,
DaffPalette,
} from '../../core/colorable/public_api';

/**
Expand All @@ -20,7 +19,7 @@ class DaffLoadingIconBase{
constructor(public _elementRef: ElementRef, public _renderer: Renderer2) {}
}

const _daffLoadingIconBase = daffColorMixin(DaffLoadingIconBase, 'primary');
const _daffLoadingIconBase = daffColorMixin(DaffLoadingIconBase);

/**
* @inheritdoc
Expand All @@ -39,8 +38,7 @@ export class DaffLoadingIconComponent extends _daffLoadingIconBase implements Da
/**
* The (pixel) diameter of the animation
*/
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
@Input() diameter: number = 60;
@Input() diameter = 60;

/**
* @docs-private
Expand Down

0 comments on commit 2649337

Please sign in to comment.