Skip to content

Commit

Permalink
docs: fix missing alert block styles in the API reference (#59020)
Browse files Browse the repository at this point in the history
Substitute legacy alert classes with the new ones.

PR Close #59020
  • Loading branch information
hawkgs authored and pkozlowski-opensource committed Dec 4, 2024
1 parent b5807c5 commit b8a2ae0
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 42 deletions.
12 changes: 8 additions & 4 deletions adev/shared-docs/styles/docs/_alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@

p {
margin-inline-start: 1.65rem;

&:first-child {
margin-block-start: 0;
}

&:last-child {
margin-block-end: 0;
}
}

.docs-dark-mode & {
Expand All @@ -39,10 +47,6 @@
}
}

.docs-viewer .docs-alert p {
margin-block: 0;
}

.docs-alert-note {
--alert-gradient: var(--blue-to-teal-vertical-gradient);
--alert-accent: var(--bright-blue);
Expand Down
2 changes: 1 addition & 1 deletion adev/src/content/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ng serve
In your browser, open http://localhost:4200/ to see the new application run.
When you use the [ng serve](cli/serve) command to build an application and serve it locally, the server automatically rebuilds the application and reloads the page when you change any of the source files.

<div class="alert is-helpful">
<div class="docs-alert docs-alert-helpful">

When you run `ng new my-first-project` a new folder, named `my-first-project`, will be created in the current working directory.
Since you want to be able to create files inside that folder, make sure you have sufficient rights in the current working directory before running the command.
Expand Down
2 changes: 1 addition & 1 deletion adev/src/content/guide/prerendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ng add @angular/ssr

</docs-code>

<div class="alert is-helpful">
<div class="docs-alert docs-alert-helpful">

To create an application with prerendering capabilities from the beginning use the [`ng new --ssr`](tools/cli/setup-local) command.

Expand Down
6 changes: 3 additions & 3 deletions packages/animations/src/animation_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSe
* - `true` and `false` also match expression values of `1` and `0` respectively (but do not match
* _truthy_ and _falsy_ values)
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* Be careful about entering end leaving elements as their transitions present a common
* pitfall for developers.
Expand Down Expand Up @@ -1205,15 +1205,15 @@ export function useAnimation(
* - Those inserted dynamically (via `ViewContainerRef`)
* - Those that have a structural directive (which, under the hood, are a subset of the above ones)
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* Note that elements will be successfully queried via `:enter`/`:leave` even if their
* insertion/removal is not done manually via `ViewContainerRef`or caused by their structural
* directive (e.g. they enter/exit alongside their parent).
*
* </div>
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* There is an exception to what previously mentioned, besides elements entering/leaving based on
* their own logic, elements with an animation trigger can always be queried via `:leave` when
Expand Down
2 changes: 1 addition & 1 deletion packages/common/http/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function makeHttpFeature<KindT extends HttpFeatureKind>(
* feature functions to `provideHttpClient`. For example, HTTP interceptors can be added using the
* `withInterceptors(...)` feature.
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* It's strongly recommended to enable
* [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) for applications that use
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/di/injection_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {ɵɵdefineInjectable} from './interface/defs';
* `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
* the `Injector`. This provides an additional level of type safety.
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* **Important Note**: Ensure that you use the same instance of the `InjectionToken` in both the
* provider and the injection call. Creating a new instance of `InjectionToken` in different places,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/i18n/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const LOCALE_ID: InjectionToken<string> = new InjectionToken(ngDevMode ?
*
* See the [i18n guide](guide/i18n/locale-id) for more information.
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* **Deprecation notice:**
*
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/render3/after_render/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export enum AfterRenderPhase {
* `AfterRenderPhase.EarlyRead` phase if reading can wait until after the write phase.
* **Never** write to the DOM in this phase.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Using this value can degrade performance.
* Instead, prefer using built-in browser functionality when possible.
Expand All @@ -55,7 +55,7 @@ export enum AfterRenderPhase {
* DOM, that haven't been refactored to use a different phase. **Never** use this phase if
* it is possible to divide the work among the other phases instead.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* Using this value can **significantly** degrade performance.
* Instead, prefer dividing work into the appropriate phase callbacks.
Expand Down
18 changes: 9 additions & 9 deletions packages/core/src/render3/after_render/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface AfterRenderOptions {
/**
* The phase the callback should be invoked in.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* Defaults to `AfterRenderPhase.MixedReadWrite`. You should choose a more specific
* phase instead. See `AfterRenderPhase` for more information.
Expand Down Expand Up @@ -83,7 +83,7 @@ export interface AfterRenderOptions {
* - `read`
* Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
* phases when possible, to avoid performance degradation.
Expand All @@ -110,7 +110,7 @@ export interface AfterRenderOptions {
* manual DOM access, ensuring the best experience for the end users of your application
* or library.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
* You must use caution when directly reading or writing the DOM and layout.
Expand Down Expand Up @@ -159,7 +159,7 @@ export function afterRender<E = never, W = never, M = never>(
* Register a callback to be invoked each time the application finishes rendering, during the
* `mixedReadWrite` phase.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* You should prefer specifying an explicit phase for the callback instead, or you risk significant
* performance degradation.
Expand All @@ -172,7 +172,7 @@ export function afterRender<E = never, W = never, M = never>(
* - on browser platforms only
* - during the `mixedReadWrite` phase
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
* You must use caution when directly reading or writing the DOM and layout.
Expand Down Expand Up @@ -254,7 +254,7 @@ export function afterRender(
* - `read`
* Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
* phases when possible, to avoid performance degradation.
Expand All @@ -281,7 +281,7 @@ export function afterRender(
* manual DOM access, ensuring the best experience for the end users of your application
* or library.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
* You must use caution when directly reading or writing the DOM and layout.
Expand Down Expand Up @@ -332,7 +332,7 @@ export function afterNextRender<E = never, W = never, M = never>(
* Register a callback to be invoked the next time the application finishes rendering, during the
* `mixedReadWrite` phase.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* You should prefer specifying an explicit phase for the callback instead, or you risk significant
* performance degradation.
Expand All @@ -344,7 +344,7 @@ export function afterNextRender<E = never, W = never, M = never>(
* - on browser platforms only
* - during the `mixedReadWrite` phase
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
* You must use caution when directly reading or writing the DOM and layout.
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/render3/reactivity/after_render_effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export type ɵFirstAvailableSignal<T extends unknown[]> = T extends [infer H, ..
* Register an effect that, when triggered, is invoked when the application finishes rendering, during the
* `mixedReadWrite` phase.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* You should prefer specifying an explicit phase for the effect instead, or you risk significant
* performance degradation.
Expand All @@ -254,7 +254,7 @@ export type ɵFirstAvailableSignal<T extends unknown[]> = T extends [infer H, ..
* - on browser platforms only
* - during the `mixedReadWrite` phase
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
* You must use caution when directly reading or writing the DOM and layout.
Expand Down Expand Up @@ -285,7 +285,7 @@ export function afterRenderEffect(
* - `read`
* Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
*
* <div class="alert is-critical">
* <div class="docs-alert docs-alert-critical">
*
* You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
* phases when possible, to avoid performance degradation.
Expand Down Expand Up @@ -313,7 +313,7 @@ export function afterRenderEffect(
* manual DOM access, ensuring the best experience for the end users of your application
* or library.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
* You must use caution when directly reading or writing the DOM and layout.
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-server/init/PACKAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The initialization happens as a [side effect of importing](https://developer.moz
import '@angular/platform-server/init';
```

<div class="alert is-important">
<div class="docs-alert docs-alert-important">

The import must come before any imports (direct or transitive) that rely on DOM built-ins being available.

Expand Down
2 changes: 1 addition & 1 deletion packages/service-worker/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class SwUpdate {
* In most cases, you should not use this method and instead should update a client by reloading
* the page.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* Updating a client without reloading can easily result in a broken application due to a version
* mismatch between the application shell and other page resources,
Expand Down
2 changes: 1 addition & 1 deletion packages/upgrade/src/common/src/downgrade_injectable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import {getTypeName, isFunction, validateInjectionKey} from './util';
*
* {@example upgrade/static/ts/full/module.ts region="example-app"}
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* When using `downgradeModule()`, downgraded injectables will not be available until the Angular
* module that provides them is instantiated. In order to be safe, you need to ensure that the
Expand Down
12 changes: 6 additions & 6 deletions packages/upgrade/static/src/downgrade_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ let moduleUid = 0;
* available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded
* component.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />
* Use one or the other.
Expand Down Expand Up @@ -98,7 +98,7 @@ let moduleUid = 0;
* For a more detailed discussion of the differences and their implications, see
* [Upgrading for Performance](https://angular.io/guide/upgrade).
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* You can manually trigger a change detection run in AngularJS using
* [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or
Expand Down Expand Up @@ -183,7 +183,7 @@ export function downgradeModule<T>(
* available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded
* component.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />
* Use one or the other.
Expand Down Expand Up @@ -214,7 +214,7 @@ export function downgradeModule<T>(
* For a more detailed discussion of the differences and their implications, see
* [Upgrading for Performance](https://angular.io/guide/upgrade).
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* You can manually trigger a change detection run in AngularJS using
* [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or
Expand Down Expand Up @@ -300,7 +300,7 @@ export function downgradeModule<T>(moduleOrBootstrapFn: NgModuleFactory<T>): str
* available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded
* component.
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />
* Use one or the other.
Expand Down Expand Up @@ -331,7 +331,7 @@ export function downgradeModule<T>(moduleOrBootstrapFn: NgModuleFactory<T>): str
* For a more detailed discussion of the differences and their implications, see
* [Upgrading for Performance](https://angular.io/guide/upgrade).
*
* <div class="alert is-helpful">
* <div class="docs-alert docs-alert-helpful">
*
* You can manually trigger a change detection run in AngularJS using
* [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ export class AngularTestingModule {
*
* <code-example path="upgrade/static/ts/full/module.spec.ts" region="angular-spec"></code-example>
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* This helper is for testing services not Components.
* For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or
* `downgradeModule` for more information.
*
* </div>
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the
* responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger
* AngularJS handlers of async events from Angular.
*
* </div>
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* The helper sets up global variables to hold the shared Angular and AngularJS injectors.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ import {UpgradeAppType} from '../../../src/common/src/util';
* <code-example path="upgrade/static/ts/full/module.spec.ts"
* region="angularjs-spec"></code-example>
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* This helper is for testing services not components.
* For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or
* `downgradeModule` for more information.
*
* </div>
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the
* responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger
* AngularJS handlers of async events from Angular.
*
* </div>
*
* <div class="alert is-important">
* <div class="docs-alert docs-alert-important">
*
* The helper sets up global variables to hold the shared Angular and AngularJS injectors.
*
Expand Down

0 comments on commit b8a2ae0

Please sign in to comment.