Skip to content

Commit 78f15b1

Browse files
authored
build: remove unused code from docs site (#31024)
There were a couple of places in the docs site where we were injecting the `ANIMATIONS_MODULE_TYPE`. They were both no-ops because we don't use the animations module for anything.
1 parent 5ee7d79 commit 78f15b1

File tree

4 files changed

+0
-29
lines changed

4 files changed

+0
-29
lines changed

docs/src/app/pages/homepage/homepage.scss

-4
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@ a.docs-link:hover {
180180
img {
181181
transition: 0.3s ease-in-out;
182182
width: 100%;
183-
184-
:host(.docs-animations-disabled) & {
185-
transition: none;
186-
}
187183
}
188184

189185
&:hover, &:focus {

docs/src/app/pages/homepage/homepage.ts

-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {Component, OnInit, inject} from '@angular/core';
10-
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
1110

1211
import {MatAnchor} from '@angular/material/button';
1312
import {MatRipple} from '@angular/material/core';
@@ -48,21 +47,12 @@ const TOP_COMPONENTS = ['datepicker', 'input', 'slide-toggle', 'slider', 'button
4847
],
4948
host: {
5049
'class': 'docs-main-content',
51-
'[class.docs-animations-disabled]': 'animationsDisabled',
5250
},
5351
})
5452
export class Homepage implements OnInit {
5553
_componentPageTitle = inject(ComponentPageTitle);
5654
guideItems = inject(GuideItems);
5755

58-
readonly animationsDisabled: boolean;
59-
60-
constructor() {
61-
const animationsModule = inject(ANIMATION_MODULE_TYPE, {optional: true});
62-
63-
this.animationsDisabled = animationsModule === 'NoopAnimations';
64-
}
65-
6656
ngOnInit(): void {
6757
this._componentPageTitle.title = '';
6858
}

docs/src/app/shared/carousel/carousel.scss

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ app-carousel {
88
flex-direction: row;
99
outline: none;
1010
transition: transform 0.5s ease-in-out;
11-
12-
.docs-animations-disabled & {
13-
transition: none;
14-
}
1511
}
1612

1713
.docs-carousel-content-wrapper {

docs/src/app/shared/carousel/carousel.ts

-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
} from '@angular/core';
2020
import {FocusableOption, FocusKeyManager} from '@angular/cdk/a11y';
2121
import {LEFT_ARROW, RIGHT_ARROW, TAB} from '@angular/cdk/keycodes';
22-
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
2322
import {MatIcon} from '@angular/material/icon';
2423
import {MatIconButton} from '@angular/material/button';
2524

@@ -46,15 +45,11 @@ export class CarouselItem implements FocusableOption {
4645
styleUrls: ['./carousel.scss'],
4746
encapsulation: ViewEncapsulation.None,
4847
imports: [MatIconButton, MatIcon],
49-
host: {
50-
'[class.docs-animations-disabled]': 'animationsDisabled',
51-
},
5248
})
5349
export class Carousel implements AfterContentInit {
5450
readonly ariaLabel = input<string | undefined>(undefined, {alias: 'aria-label'});
5551
readonly items = contentChildren(CarouselItem);
5652
readonly list = viewChild.required<ElementRef<HTMLElement>>('list');
57-
readonly animationsDisabled: boolean;
5853
position = 0;
5954
showPrevArrow = false;
6055
showNextArrow = true;
@@ -83,12 +78,6 @@ export class Carousel implements AfterContentInit {
8378
}
8479
}
8580

86-
constructor() {
87-
const animationsModule = inject(ANIMATION_MODULE_TYPE, {optional: true});
88-
89-
this.animationsDisabled = animationsModule === 'NoopAnimations';
90-
}
91-
9281
ngAfterContentInit(): void {
9382
this._keyManager = new FocusKeyManager<CarouselItem>(this.items());
9483
}

0 commit comments

Comments
 (0)