Skip to content

Commit 2d465ee

Browse files
sjtrimbleAndrewKushnir
authored andcommitted
feat(docs-infra): implement figure styles (#33259)
PR#28396 originally addressed an update via issue #23983 to make images more visible with a white background (implementation of gray "lightbox"). This PR implements those styles defined in PR#28396. PR Close #33259
1 parent 70238f7 commit 2d465ee

46 files changed

Lines changed: 666 additions & 340 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

aio/content/guide/animations.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ Let's animate a simple transition that changes a single HTML element from one st
6969

7070
In HTML, these attributes are set using ordinary CSS styles such as color and opacity. In Angular, use the `style()` function to specify a set of CSS styles for use with animations. You can collect a set of styles in an animation state, and give the state a name, such as `open` or `closed`.
7171

72-
<figure>
73-
<img src="generated/images/guide/animations/open-closed.png" alt="open and closed states">
72+
<figure class="lightbox">
73+
<div class="card">
74+
<img src="generated/images/guide/animations/open-closed.png" alt="open and closed states">
75+
</div>
7476
</figure>
7577

7678
### Animation state and styles
@@ -166,8 +168,10 @@ The `trigger()` function describes the property name to watch for changes. When
166168

167169
In this example, we'll name the trigger `openClose`, and attach it to the `button` element. The trigger describes the open and closed states, and the timings for the two transitions.
168170

169-
<figure>
170-
<img src="generated/images/guide/animations/triggering-the-animation.png" alt="triggering the animation">
171+
<figure class="lightbox">
172+
<div class="card">
173+
<img src="generated/images/guide/animations/triggering-the-animation.png" alt="triggering the animation">
174+
</div>
171175
</figure>
172176

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

aio/content/guide/architecture-components.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ You define a component's view with its companion template. A template is a form
5151

5252
Views are typically arranged hierarchically, allowing you to modify or show and hide entire UI sections or pages as a unit. The template immediately associated with a component defines that component's *host view*. The component can also define a *view hierarchy*, which contains *embedded views*, hosted by other components.
5353

54-
<figure>
55-
<img src="generated/images/guide/architecture/component-tree.png" alt="Component tree" class="left">
54+
<figure class="lightbox">
55+
<div class="card">
56+
<img src="generated/images/guide/architecture/component-tree.png" alt="Component tree" class="left">
57+
</div>
5658
</figure>
5759

5860
A view hierarchy can include views from components in the same NgModule, but it also can (and often does) include views from components that are defined in different NgModules.
@@ -81,8 +83,10 @@ Angular supports *two-way data binding*, a mechanism for coordinating the parts
8183

8284
The following diagram shows the four forms of data binding markup. Each form has a direction: to the DOM, from the DOM, or both.
8385

84-
<figure>
85-
<img src="generated/images/guide/architecture/databinding.png" alt="Data Binding" class="left">
86+
<figure class="lightbox">
87+
<div class="card">
88+
<img src="generated/images/guide/architecture/databinding.png" alt="Data Binding" class="left">
89+
</div>
8690
</figure>
8791

8892
This example from the `HeroListComponent` template uses three of these forms.
@@ -110,14 +114,18 @@ as with event binding.
110114
Angular processes *all* data bindings once for each JavaScript event cycle,
111115
from the root of the application component tree through all child components.
112116

113-
<figure>
114-
<img src="generated/images/guide/architecture/component-databinding.png" alt="Data Binding" class="left">
117+
<figure class="lightbox">
118+
<div class="card">
119+
<img src="generated/images/guide/architecture/component-databinding.png" alt="Data Binding" class="left">
120+
</div>
115121
</figure>
116122

117123
Data binding plays an important role in communication between a template and its component, and is also important for communication between parent and child components.
118124

119-
<figure>
120-
<img src="generated/images/guide/architecture/parent-child-binding.png" alt="Parent/Child binding" class="left">
125+
<figure class="lightbox">
126+
<div class="card">
127+
<img src="generated/images/guide/architecture/parent-child-binding.png" alt="Parent/Child binding" class="left">
128+
</div>
121129
</figure>
122130

123131
### Pipes

aio/content/guide/architecture-modules.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ Here's a simple root NgModule definition.
3535

3636
NgModules provide a *compilation context* for their components. A root NgModule always has a root component that is created during bootstrap, but any NgModule can include any number of additional components, which can be loaded through the router or created through the template. The components that belong to an NgModule share a compilation context.
3737

38-
<figure>
39-
40-
<img src="generated/images/guide/architecture/compilation-context.png" alt="Component compilation context" class="left">
41-
38+
<figure class="lightbox">
39+
<div class="card">
40+
<img src="generated/images/guide/architecture/compilation-context.png" alt="Component compilation context" class="left">
41+
</div>
4242
</figure>
4343

4444
<br class="clear">
4545

4646
A component and its template together define a *view*. A component can contain a *view hierarchy*, which allows you to define arbitrarily complex areas of the screen that can be created, modified, and destroyed as a unit. A view hierarchy can mix views defined in components that belong to different NgModules. This is often the case, especially for UI libraries.
4747

48-
<figure>
49-
50-
<img src="generated/images/guide/architecture/view-hierarchy.png" alt="View hierarchy" class="left">
51-
48+
<figure class="lightbox">
49+
<div class="card">
50+
<img src="generated/images/guide/architecture/view-hierarchy.png" alt="View hierarchy" class="left">
51+
</div>
5252
</figure>
5353

5454
<br class="clear">

aio/content/guide/architecture-services.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ When all requested services have been resolved and returned, Angular can call th
7070

7171
The process of `HeroService` injection looks something like this.
7272

73-
<figure>
74-
<img src="generated/images/guide/architecture/injector-injects.png" alt="Service" class="left">
73+
<figure class="lightbox">
74+
<div class="card">
75+
<img src="generated/images/guide/architecture/injector-injects.png" alt="Service" class="left">
76+
</div>
7577
</figure>
7678

7779
### Providing services

aio/content/guide/architecture.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ To define navigation rules, you associate *navigation paths* with your component
113113

114114
You've learned the basics about the main building blocks of an Angular application. The following diagram shows how these basic pieces are related.
115115

116-
<figure>
117-
<img src="generated/images/guide/architecture/overview2.png" alt="overview">
116+
<figure class="lightbox">
117+
<div class="card">
118+
<img src="generated/images/guide/architecture/overview2.png" alt="overview">
119+
</div>
118120
</figure>
119121

120122
* Together, a component and template define an Angular view.

aio/content/guide/attribute-directives.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,10 @@ Here's the updated directive in full:
175175
Run the app and confirm that the background color appears when
176176
the mouse hovers over the `p` and disappears as it moves out.
177177

178-
<figure>
179-
<img src="generated/images/guide/attribute-directives/highlight-directive-anim.gif" alt="Second Highlight">
178+
<figure class="lightbox">
179+
<div class="card">
180+
<img src="generated/images/guide/attribute-directives/highlight-directive-anim.gif" alt="Second Highlight">
181+
</div>
180182
</figure>
181183

182184
{@a bindings}
@@ -271,8 +273,10 @@ Revise the `AppComponent.color` so that it has no initial value.
271273

272274
Here are the harness and directive in action.
273275

274-
<figure>
275-
<img src="generated/images/guide/attribute-directives/highlight-directive-v2-anim.gif" alt="Highlight v.2">
276+
<figure class="lightbox">
277+
<div class="card">
278+
<img src="generated/images/guide/attribute-directives/highlight-directive-v2-anim.gif" alt="Highlight v.2">
279+
</div>
276280
</figure>
277281

278282
{@a second-property}
@@ -307,8 +311,10 @@ because you made it _public_ with the `@Input` decorator.
307311

308312
Here's how the harness should work when you're done coding.
309313

310-
<figure>
311-
<img src="generated/images/guide/attribute-directives/highlight-directive-final-anim.gif" alt="Final Highlight">
314+
<figure class="lightbox">
315+
<div class="card">
316+
<img src="generated/images/guide/attribute-directives/highlight-directive-final-anim.gif" alt="Final Highlight">
317+
</div>
312318
</figure>
313319

314320
## Summary

aio/content/guide/component-interaction.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ and each iteration's `hero` instance to the child's `hero` property.
5050
The running application displays three heroes:
5151

5252

53-
<figure>
54-
<img src="generated/images/guide/component-interaction/parent-to-child.png" alt="Parent-to-child">
53+
<figure class="lightbox">
54+
<div class="card">
55+
<img src="generated/images/guide/component-interaction/parent-to-child.png" alt="Parent-to-child">
56+
</div>
5557
</figure>
5658

5759

@@ -94,8 +96,10 @@ Here's the `NameParentComponent` demonstrating name variations including a name
9496

9597

9698

97-
<figure>
98-
<img src="generated/images/guide/component-interaction/setter.png" alt="Parent-to-child-setter">
99+
<figure class="lightbox">
100+
<div class="card">
101+
<img src="generated/images/guide/component-interaction/setter.png" alt="Parent-to-child-setter">
102+
</div>
99103
</figure>
100104

101105

@@ -152,8 +156,10 @@ The `VersionParentComponent` supplies the `minor` and `major` values and binds b
152156
Here's the output of a button-pushing sequence:
153157

154158

155-
<figure>
156-
<img src="generated/images/guide/component-interaction/parent-to-child-on-changes.gif" alt="Parent-to-child-onchanges">
159+
<figure class="lightbox">
160+
<div class="card">
161+
<img src="generated/images/guide/component-interaction/parent-to-child-on-changes.gif" alt="Parent-to-child-onchanges">
162+
</div>
157163
</figure>
158164

159165

@@ -206,8 +212,10 @@ The framework passes the event argument&mdash;represented by `$event`&mdash;to t
206212
and the method processes it:
207213

208214

209-
<figure>
210-
<img src="generated/images/guide/component-interaction/child-to-parent.gif" alt="Child-to-parent">
215+
<figure class="lightbox">
216+
<div class="card">
217+
<img src="generated/images/guide/component-interaction/child-to-parent.gif" alt="Child-to-parent">
218+
</div>
211219
</figure>
212220

213221

@@ -268,8 +276,10 @@ uses interpolation to display the child's `seconds` property.
268276
Here we see the parent and child working together.
269277

270278

271-
<figure>
272-
<img src="generated/images/guide/component-interaction/countdown-timer-anim.gif" alt="countdown timer">
279+
<figure class="lightbox">
280+
<div class="card">
281+
<img src="generated/images/guide/component-interaction/countdown-timer-anim.gif" alt="countdown timer">
282+
</div>
273283
</figure>
274284

275285

@@ -421,8 +431,10 @@ the parent `MissionControlComponent` and the `AstronautComponent` children,
421431
facilitated by the service:
422432

423433

424-
<figure>
425-
<img src="generated/images/guide/component-interaction/bidirectional-service.gif" alt="bidirectional-service">
434+
<figure class="lightbox">
435+
<div class="card">
436+
<img src="generated/images/guide/component-interaction/bidirectional-service.gif" alt="bidirectional-service">
437+
</div>
426438
</figure>
427439

428440

aio/content/guide/dependency-injection-in-action.md

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ and the framework resolves the nested dependencies.
4040

4141
When all dependencies are in place, `AppComponent` displays the user information.
4242

43-
<figure>
44-
<img src="generated/images/guide/dependency-injection-in-action/logged-in-user.png" alt="Logged In User">
43+
<figure class="lightbox">
44+
<div class="card">
45+
<img src="generated/images/guide/dependency-injection-in-action/logged-in-user.png" alt="Logged In User">
46+
</div>
4547
</figure>
4648

4749
{@a service-scope}
@@ -131,8 +133,10 @@ The template displays this data-bound property.
131133
Find this example in <live-example name="dependency-injection-in-action">live code</live-example>
132134
and confirm that the three `HeroBioComponent` instances have their own cached hero data.
133135

134-
<figure>
135-
<img src="generated/images/guide/dependency-injection-in-action/hero-bios.png" alt="Bios">
136+
<figure class="lightbox">
137+
<div class="card">
138+
<img src="generated/images/guide/dependency-injection-in-action/hero-bios.png" alt="Bios">
139+
</div>
136140
</figure>
137141

138142
{@a qualify-dependency-lookup}
@@ -191,8 +195,10 @@ placing it in the `<ng-content>` slot of the `HeroBioComponent` template.
191195

192196
The result is shown below, with the hero's telephone number from `HeroContactComponent` projected above the hero description.
193197

194-
<figure>
195-
<img src="generated/images/guide/dependency-injection-in-action/hero-bio-and-content.png" alt="bio and contact">
198+
<figure class="lightbox">
199+
<div class="card">
200+
<img src="generated/images/guide/dependency-injection-in-action/hero-bio-and-content.png" alt="bio and contact">
201+
</div>
196202
</figure>
197203

198204

@@ -221,8 +227,10 @@ When the property is marked as optional, Angular sets `loggerService` to null an
221227

222228
Here's `HeroBiosAndContactsComponent` in action.
223229

224-
<figure>
225-
<img src="generated/images/guide/dependency-injection-in-action/hero-bios-and-contacts.png" alt="Bios with contact into">
230+
<figure class="lightbox">
231+
<div class="card">
232+
<img src="generated/images/guide/dependency-injection-in-action/hero-bios-and-contacts.png" alt="Bios with contact into">
233+
</div>
226234
</figure>
227235

228236

@@ -232,8 +240,10 @@ until it finds the logger at the `AppComponent` level.
232240
The logger logic kicks in and the hero display updates
233241
with the "!!!" marker to indicate that the logger was found.
234242

235-
<figure>
236-
<img src="generated/images/guide/dependency-injection-in-action/hero-bio-contact-no-host.png" alt="Without @Host">
243+
<figure class="lightbox">
244+
<div class="card">
245+
<img src="generated/images/guide/dependency-injection-in-action/hero-bio-contact-no-host.png" alt="Without @Host">
246+
</div>
237247
</figure>
238248

239249

@@ -294,8 +304,10 @@ first without a value (yielding the default color) and then with an assigned col
294304

295305
The following image shows the effect of mousing over the `<hero-bios-and-contacts>` tag.
296306

297-
<figure>
298-
<img src="generated/images/guide/dependency-injection-in-action/highlight.png" alt="Highlighted bios">
307+
<figure class="lightbox">
308+
<div class="card">
309+
<img src="generated/images/guide/dependency-injection-in-action/highlight.png" alt="Highlighted bios">
310+
</div>
299311
</figure>
300312

301313
{@a providers}
@@ -347,8 +359,10 @@ You learned about some other methods in [Dependency Providers](guide/dependency-
347359
The following `HeroOfTheMonthComponent` example demonstrates many of the alternatives and why you need them.
348360
It's visually simple: a few properties and the logs produced by a logger.
349361

350-
<figure>
351-
<img src="generated/images/guide/dependency-injection-in-action/hero-of-month.png" alt="Hero of the month">
362+
<figure class="lightbox">
363+
<div class="card">
364+
<img src="generated/images/guide/dependency-injection-in-action/hero-of-month.png" alt="Hero of the month">
365+
</div>
352366
</figure>
353367

354368
The code behind it customizes how and where the DI framework provides dependencies.
@@ -460,8 +474,10 @@ The following example puts `MinimalLogger` to use in a simplified version of `He
460474

461475
The `HeroOfTheMonthComponent` constructor's `logger` parameter is typed as `MinimalLogger`, so only the `logs` and `logInfo` members are visible in a TypeScript-aware editor.
462476

463-
<figure>
464-
<img src="generated/images/guide/dependency-injection-in-action/minimal-logger-intellisense.png" alt="MinimalLogger restricted API">
477+
<figure class="lightbox">
478+
<div class="card">
479+
<img src="generated/images/guide/dependency-injection-in-action/minimal-logger-intellisense.png" alt="MinimalLogger restricted API">
480+
</div>
465481
</figure>
466482

467483

@@ -472,8 +488,10 @@ Behind the scenes, Angular sets the `logger` parameter to the full service regis
472488

473489
This is illustrated in the following image, which displays the logging date.
474490

475-
<figure>
476-
<img src="generated/images/guide/dependency-injection-in-action/date-logger-entry.png" alt="DateLoggerService entry">
491+
<figure class="lightbox">
492+
<div class="card">
493+
<img src="generated/images/guide/dependency-injection-in-action/date-logger-entry.png" alt="DateLoggerService entry">
494+
</div>
477495
</figure>
478496

479497
</div>
@@ -627,8 +645,10 @@ and then pass them down to the base class through the constructor.
627645
In this contrived example, `SortedHeroesComponent` inherits from `HeroesBaseComponent`
628646
to display a *sorted* list of heroes.
629647

630-
<figure>
631-
<img src="generated/images/guide/dependency-injection-in-action/sorted-heroes.png" alt="Sorted Heroes">
648+
<figure class="lightbox">
649+
<div class="card">
650+
<img src="generated/images/guide/dependency-injection-in-action/sorted-heroes.png" alt="Sorted Heroes">
651+
</div>
632652
</figure>
633653

634654
The `HeroesBaseComponent` can stand on its own.

0 commit comments

Comments
 (0)