From 23596b3f304a931733e761e75e0c1371bdd1995a Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 25 Jan 2018 13:48:14 +0000 Subject: [PATCH] docs(aio): fix missing stylesheet in component-styles example (#21772) The code in the example was referring to `hero-app.component.css` but this did not exist. PR Close #21772 --- ...component.1.css => hero-app.component.css} | 0 aio/content/guide/component-styles.md | 46 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) rename aio/content/examples/component-styles/src/app/{hero-app.component.1.css => hero-app.component.css} (100%) diff --git a/aio/content/examples/component-styles/src/app/hero-app.component.1.css b/aio/content/examples/component-styles/src/app/hero-app.component.css similarity index 100% rename from aio/content/examples/component-styles/src/app/hero-app.component.1.css rename to aio/content/examples/component-styles/src/app/hero-app.component.css diff --git a/aio/content/guide/component-styles.md b/aio/content/guide/component-styles.md index b9c473452d..3c0269dd59 100644 --- a/aio/content/guide/component-styles.md +++ b/aio/content/guide/component-styles.md @@ -14,7 +14,7 @@ You can run the in Stackblitz and download the cod ## Using component styles For every Angular component you write, you may define not only an HTML template, -but also the CSS styles that go with that template, +but also the CSS styles that go with that template, specifying any selectors, rules, and media queries that you need. One way to do this is to set the `styles` property in the component metadata. @@ -42,7 +42,7 @@ This scoping restriction is a ***styling modularity feature***. * You can use the CSS class names and selectors that make the most sense in the context of each component. -* Class names and selectors are local to the component and don't collide with +* Class names and selectors are local to the component and don't collide with classes and selectors used elsewhere in the application. @@ -61,7 +61,7 @@ This scoping restriction is a ***styling modularity feature***. ## Special selectors Component styles have a few special *selectors* from the world of shadow DOM style scoping -(described in the [CSS Scoping Module Level 1](https://www.w3.org/TR/css-scoping-1) page on the +(described in the [CSS Scoping Module Level 1](https://www.w3.org/TR/css-scoping-1) page on the [W3C](https://www.w3.org) site). The following sections describe these selectors. @@ -78,7 +78,7 @@ The `:host` selector is the only way to target the host element. You can't reach the host element from inside the component with other selectors because it's not part of the component's own template. The host element is in a parent component's template. -Use the *function form* to apply host styles conditionally by +Use the *function form* to apply host styles conditionally by including another selector inside parentheses after `:host`. The next example targets the host element again, but only when it also has the `active` CSS class. @@ -104,15 +104,15 @@ if some ancestor element has the CSS class `theme-light`. ### (deprecated) `/deep/`, `>>>`, and `::ng-deep` -Component styles normally apply only to the HTML in the component's own template. +Component styles normally apply only to the HTML in the component's own template. Use the `/deep/` shadow-piercing descendant combinator to force a style down through the child component tree into all the child component views. The `/deep/` combinator works to any depth of nested components, and it applies to both the view -children and content children of the component. +children and content children of the component. -The following example targets all `

` elements, from the host element down -through this component to all of its child elements in the DOM. +The following example targets all `

` elements, from the host element down +through this component to all of its child elements in the DOM. @@ -140,7 +140,7 @@ Until then `::ng-deep` should be preferred for a broader compatibility with the ## Loading component styles -There are several ways to add styles to a component: +There are several ways to add styles to a component: * By setting `styles` or `styleUrls` metadata. * Inline in the template HTML. @@ -177,8 +177,8 @@ to a component's `@Component` decorator: - - + +
@@ -209,14 +209,14 @@ inside `