diff --git a/aio/content/examples/toh-pt6/e2e/src/app.e2e-spec.ts b/aio/content/examples/toh-pt6/e2e/src/app.e2e-spec.ts index f9c8b74904..1856368208 100644 --- a/aio/content/examples/toh-pt6/e2e/src/app.e2e-spec.ts +++ b/aio/content/examples/toh-pt6/e2e/src/app.e2e-spec.ts @@ -53,7 +53,7 @@ describe('Tutorial part 6', () => { appDashboardHref: navElts.get(0), appDashboard: element(by.css('app-root app-dashboard')), - topHeroes: element.all(by.css('app-root app-dashboard > div h4')), + topHeroes: element.all(by.css('app-root app-dashboard > div a')), appHeroesHref: navElts.get(1), appHeroes: element(by.css('app-root app-heroes')), @@ -176,7 +176,7 @@ describe('Tutorial part 6', () => { const numHeroes = heroesBefore.length; await element(by.css('input')).sendKeys(addedHeroName); - await element(by.buttonText('add')).click(); + await element(by.buttonText('Add hero')).click(); const page = getPageElts(); const heroesAfter = await toHeroArray(page.allHeroes); @@ -195,18 +195,18 @@ describe('Tutorial part 6', () => { // Inherited styles from styles.css expect(await button.getCssValue('font-family')).toBe('Arial, sans-serif'); expect(await button.getCssValue('border')).toContain('none'); - expect(await button.getCssValue('padding')).toBe('5px 10px'); + expect(await button.getCssValue('padding')).toBe('1px 10px 3px'); expect(await button.getCssValue('border-radius')).toBe('4px'); // Styles defined in heroes.component.css - expect(await button.getCssValue('left')).toBe('194px'); - expect(await button.getCssValue('top')).toBe('-32px'); + expect(await button.getCssValue('left')).toBe('210px'); + expect(await button.getCssValue('top')).toBe('5px'); } - const addButton = element(by.buttonText('add')); + const addButton = element(by.buttonText('Add hero')); // Inherited styles from styles.css expect(await addButton.getCssValue('font-family')).toBe('Arial, sans-serif'); expect(await addButton.getCssValue('border')).toContain('none'); - expect(await addButton.getCssValue('padding')).toBe('5px 10px'); + expect(await addButton.getCssValue('padding')).toBe('8px 24px'); expect(await addButton.getCssValue('border-radius')).toBe('4px'); }); diff --git a/aio/content/examples/toh-pt6/src/app/app.component.css b/aio/content/examples/toh-pt6/src/app/app.component.css index 1bdf7bdd58..114a0b70dd 100644 --- a/aio/content/examples/toh-pt6/src/app/app.component.css +++ b/aio/content/examples/toh-pt6/src/app/app.component.css @@ -1,23 +1,20 @@ /* AppComponent's private CSS styles */ h1 { - font-size: 1.2em; margin-bottom: 0; } nav a { - padding: 5px 10px; + padding: 1rem; text-decoration: none; margin-top: 10px; display: inline-block; - background-color: #eee; + background-color: #e8e8e8; + color: #3d3d3d; border-radius: 4px; } -nav a:visited, a:link { - color: #334953; -} nav a:hover { - color: #039be5; - background-color: #CFD8DC; + color: white; + background-color: #42545C; } nav a.active { - color: #039be5; + background-color: black; } diff --git a/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.css b/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.css index 031b2e382f..b1e6e6785e 100644 --- a/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.css +++ b/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.css @@ -1,61 +1,54 @@ /* DashboardComponent's private CSS styles */ -[class*='col-'] { - float: left; - padding-right: 20px; - padding-bottom: 20px; + +h2 { + text-align: center; } -[class*='col-']:last-of-type { - padding-right: 0; + +.heroes-menu { + padding: 0; + margin: auto; + max-width: 1000px; + + /* flexbox */ + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-around; + align-content: flex-start; + align-items: flex-start; } + a { - text-decoration: none; -} -*, *::after, *::before { - box-sizing: border-box; -} -h3 { - text-align: center; - margin-bottom: 0; -} -h4 { - position: relative; -} -.grid { - margin: 0; -} -.col-1-4 { - width: 25%; -} -.module { - padding: 20px; - text-align: center; - color: #eee; - max-height: 120px; - min-width: 120px; background-color: #3f525c; border-radius: 2px; + padding: 1rem; + font-size: 1.2rem; + text-decoration: none; + display: inline-block; + color: #fff; + text-align: center; + width: 100%; + min-width: 70px; + margin: .5rem auto; + box-sizing: border-box; + + /* flexbox */ + order: 0; + flex: 0 1 auto; + align-self: auto; } -.module:hover { - background-color: #EEE; - cursor: pointer; - color: #607d8b; -} -.grid-pad { - padding: 10px 0; -} -.grid-pad > [class*='col-']:last-of-type { - padding-right: 20px; -} -@media (max-width: 600px) { - .module { - font-size: 10px; - max-height: 75px; } -} -@media (max-width: 1024px) { - .grid { - margin: 0; - } - .module { - min-width: 60px; + +@media (min-width: 600px) { + a { + width: 18%; + box-sizing: content-box; } } + +a:hover { + background-color: black; +} diff --git a/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.html b/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.html index b70c0c7d6e..9a20700f46 100644 --- a/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.html +++ b/aio/content/examples/toh-pt6/src/app/dashboard/dashboard.component.html @@ -1,10 +1,8 @@ -
+