Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
fix: Use 'ngx' prefix naming for extended Sass (#1598)
Browse files Browse the repository at this point in the history
Change `ng-` to `ngx-`.
  • Loading branch information
trimox authored Dec 13, 2018
1 parent 197cfa4 commit 7e61941
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions packages/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { MdcIcon } from '@angular-mdc/web/icon';
host: {
'[tabIndex]': 'disabled ? -1 : 0',
'class': 'mdc-button',
'[class.ng-mdc-button--primary]': 'primary',
'[class.ng-mdc-button--secondary]': 'secondary',
'[class.ngx-mdc-button--primary]': 'primary',
'[class.ngx-mdc-button--secondary]': 'secondary',
'[class.mdc-button--raised]': 'raised',
'[class.mdc-button--dense]': 'dense',
'[class.mdc-button--unelevated]': 'unelevated',
Expand Down
4 changes: 2 additions & 2 deletions packages/chips/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export class MdcChipText {
'[id]': 'id',
'[attr.tabindex]': 'disabled ? null : 0',
'class': 'mdc-chip',
'[class.ng-mdc-chip--primary]': 'primary',
'[class.ng-mdc-chip--secondary]': 'secondary'
'[class.ngx-mdc-chip--primary]': 'primary',
'[class.ngx-mdc-chip--secondary]': 'secondary'
},
template: `
<ng-container [ngSwitch]="filter">
Expand Down
4 changes: 2 additions & 2 deletions packages/fab/fab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export class MdcFab implements AfterContentInit, OnDestroy {
get position(): string | null { return this._position; }
set position(value: string | null) {
if (this._position) {
this._getHostElement().classList.remove(`ng-mdc-fab--${this._convertPosition(this._position)}`);
this._getHostElement().classList.remove(`ngx-mdc-fab--${this._convertPosition(this._position)}`);
}
if (value) {
this._getHostElement().classList.add(`ng-mdc-fab--${this._convertPosition(value)}`);
this._getHostElement().classList.add(`ngx-mdc-fab--${this._convertPosition(value)}`);
}
this._position = value;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/list/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class MdcListGroupSubheader {
'[attr.aria-orientation]': 'verticalOrientation ? "vertical" : "horizontal"',
'[class.mdc-list--dense]': 'dense',
'[class.mdc-list--avatar-list]': 'avatar',
'[class.ng-mdc-list--border]': 'border',
'[class.ngx-mdc-list--border]': 'border',
'[class.mdc-list--non-interactive]': '!interactive',
'[class.mdc-list--two-line]': 'twoLine'
},
Expand Down
4 changes: 2 additions & 2 deletions packages/material-components-web/extend/mdc-button.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.ng-mdc-button--primary {
.ngx-mdc-button--primary {
@include mdc-button-filled-accessible($mdc-theme-primary);
}

.ng-mdc-button--secondary {
.ngx-mdc-button--secondary {
@include mdc-button-filled-accessible($mdc-theme-secondary);
}
4 changes: 2 additions & 2 deletions packages/material-components-web/extend/mdc-chips.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.ng-mdc-chip--primary {
.ngx-mdc-chip--primary {
@include mdc-chip-fill-color-accessible($mdc-theme-primary);
}

.ng-mdc-chip--secondary {
.ngx-mdc-chip--secondary {
@include mdc-chip-fill-color-accessible($mdc-theme-secondary);
}
8 changes: 4 additions & 4 deletions packages/material-components-web/extend/mdc-fab.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
.ng-mdc-fab--bottom-right {
.ngx-mdc-fab--bottom-right {
position: fixed;
right: 1rem;
bottom: 1rem;
}

@media (min-width: 1024px) {
.ng-mdc-fab--bottom-right {
.ngx-mdc-fab--bottom-right {
right: 1.5rem;
bottom: 1.5rem;
}
}

.ng-mdc-fab--bottom-left {
.ngx-mdc-fab--bottom-left {
position: fixed;
bottom: 1rem;
left: 1rem;
}

@media (min-width: 1024px) {
.ng-mdc-fab--bottom-left {
.ngx-mdc-fab--bottom-left {
bottom: 1.5rem;
left: 1.5rem;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-components-web/extend/mdc-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
display: block;
}

.ng-mdc-list--border {
.ngx-mdc-list--border {
.mdc-list-item {
/* Add the list side padding padding to the list item. */
padding: 0 16px;
Expand Down
2 changes: 1 addition & 1 deletion packages/material-components-web/extend/mdc-snackbar.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.ng-mdc-snackbar--align-end {
.ngx-mdc-snackbar--align-end {
@media (min-width: $mdc-snackbar-tablet-breakpoint) {
@include mdc-rtl-reflexive-position(right, 24px);

Expand Down
2 changes: 1 addition & 1 deletion packages/material-components-web/extend/mdc-tab.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.ng-mdc-tab--disabled {
.ngx-mdc-tab--disabled {
@include mdc-tab-text-label-color(rgba(black, .3));
@include mdc-tab-icon-color(rgba(black, .3));

Expand Down
2 changes: 1 addition & 1 deletion packages/snackbar/snackbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class MdcSnackbarComponent implements AfterViewInit, OnDestroy {
if (config.align === 'start') {
this._getHostElement().classList.add('mdc-snackbar--align-start');
} else if (config.align === 'end') {
this._getHostElement().classList.add('ng-mdc-snackbar--align-end');
this._getHostElement().classList.add('ngx-mdc-snackbar--align-end');
}

if (!config.actionHandler && config.data.actionText) {
Expand Down
2 changes: 1 addition & 1 deletion packages/tab/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class MdcTabIcon {
'[class.mdc-tab--active]': 'active',
'[class.mdc-tab--stacked]': 'stacked',
'[class.mdc-tab--min-width]': 'fixed',
'[class.ng-mdc-tab--disabled]': 'disabled'
'[class.ngx-mdc-tab--disabled]': 'disabled'
},
template: `
<div #content class="mdc-tab__content">
Expand Down
4 changes: 2 additions & 2 deletions test/button/button.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ describe('MdcButton', () => {

testComponent.isPrimary = true;
fixture.detectChanges();
expect(buttonDebugElement.nativeElement.classList.contains('ng-mdc-button--primary')).toBe(true);
expect(buttonDebugElement.nativeElement.classList.contains('ngx-mdc-button--primary')).toBe(true);

testComponent.isSecondary = true;
fixture.detectChanges();
expect(buttonDebugElement.nativeElement.classList.contains('ng-mdc-button--secondary')).toBe(true);
expect(buttonDebugElement.nativeElement.classList.contains('ngx-mdc-button--secondary')).toBe(true);
});

it('#should handle a click on the button', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/chips/chips.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ describe('Chips', () => {
it('#should apply primary class modifier', () => {
testComponent.primary = true;
fixture.detectChanges();
expect(testDebugElement.nativeElement.classList.contains('ng-mdc-chip--primary')).toBe(true);
expect(testDebugElement.nativeElement.classList.contains('ngx-mdc-chip--primary')).toBe(true);
});

it('#should apply secondary class modifier', () => {
testComponent.secondary = true;
fixture.detectChanges();
expect(testDebugElement.nativeElement.classList.contains('ng-mdc-chip--secondary')).toBe(true);
expect(testDebugElement.nativeElement.classList.contains('ngx-mdc-chip--secondary')).toBe(true);
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/fab/fab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ describe('MdcFab', () => {
it('#should apply class `bottomLeft`', () => {
testComponent.myPosition = 'bottomLeft';
fixture.detectChanges();
expect(buttonDebugElement.nativeElement.classList.contains('ng-mdc-fab--bottom-left')).toBe(true);
expect(buttonDebugElement.nativeElement.classList.contains('ngx-mdc-fab--bottom-left')).toBe(true);
});

it('#should apply class `bottom-right`', () => {
testComponent.myPosition = 'bottomRight';
fixture.detectChanges();

expect(buttonInstance.position).toBe('bottomRight');
expect(buttonDebugElement.nativeElement.classList.contains('ng-mdc-fab--bottom-right')).toBe(true);
expect(buttonDebugElement.nativeElement.classList.contains('ngx-mdc-fab--bottom-right')).toBe(true);
});

it('#should store position but not add class', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/list/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('MdcListModule', () => {
it('#should apply class border', () => {
testComponent.isBordered = true;
fixture.detectChanges();
expect(testDebugElement.nativeElement.classList.contains('ng-mdc-list--border')).toBe(true);
expect(testDebugElement.nativeElement.classList.contains('ngx-mdc-list--border')).toBe(true);
});

it('#should apply class dense', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tabs/tabs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('MDC Tabs', () => {
fixture.detectChanges();
flush();

expect(testInstance.tabs.toArray()[0].elementRef.nativeElement.classList.contains('ng-mdc-tab--disabled')).toBe(true);
expect(testInstance.tabs.toArray()[0].elementRef.nativeElement.classList.contains('ngx-mdc-tab--disabled')).toBe(true);
}));

it('#should turn on stacked for tabs', fakeAsync(() => {
Expand Down

0 comments on commit 7e61941

Please sign in to comment.