feat(aio): code blocks, copy bttn, a tag hover

This commit is contained in:
Stefanie Fluin 2017-03-27 15:37:11 -07:00 committed by Igor Minar
parent 5942b2b27c
commit 146b30796e
5 changed files with 38 additions and 12 deletions

View File

@ -18,7 +18,7 @@ export interface TabInfo {
selector: 'code-tabs',
template: `
<md-tab-group>
<md-tab *ngFor="let tab of tabs">
<md-tab style="overflow-y: hidden;" *ngFor="let tab of tabs">
<template md-tab-label>
<span class="{{tab.class}}">{{ tab.title }}</span>
</template>

View File

@ -23,8 +23,9 @@ const copiedLabel = 'Copied!';
@Component({
selector: 'aio-code',
template: `
<button class="copy-button" #copyButton (click)="doCopy()">{{ buttonLabel }}</button>
<pre class="prettyprint lang-{{language}}">
<button class="material-icons copy-button" #copyButton (click)="doCopy()">content_copy</button>
<code class="animated fadeIn" #codeContainer></code>
</pre>
`

View File

@ -107,7 +107,7 @@
text-align: left;
}
p code {
p > code {
font-family: $code-font;
font-size: 90%;
color: $blue;
@ -120,6 +120,9 @@
.sidenav-content a {
color: $blue;
&:hover {
color: $mediumgray;
}
}
// }

View File

@ -11,12 +11,16 @@ aio-search-results {
width: 100%;
max-height: 40%;
position: fixed;
display: flex;
top: 0;
left: 0;
right: 0;
background-color: $darkgray;
border: 24px solid $darkgray;
@include bp(tiny) {
display: block;
max-height: 60%;
}
}
.search-area {
@ -43,5 +47,6 @@ aio-search-results {
@include bp(tiny) {
width: 100%;
display: block;
}
}

View File

@ -5,8 +5,8 @@ code-tabs md-tab-body {
border-radius: 5px;
color: $darkgray;
display: block;
padding: 10px;
margin: 24px auto;
padding: 8px;
margin: 16px auto;
}
code-example header {
@ -29,16 +29,33 @@ code-tabs.is-anti-pattern md-tab-body {
border: 0.5px solid $anti-pattern;
}
code-tabs div .mat-tab-body-content {
height: auto;
}
code-tabs .mat-tab-body-wrapper md-tab-body .mat-tab-body {
overflow-y: hidden;
}
code-tabs mat-tab-body-content .fadeIn {
animation: opacity 2s ease-in;
}
aio-code pre {
display: flex;
line-height: 1.5;
margin: 0px;
padding: 0px;
white-space: pre-wrap;
li {
line-height: 60%;
}
}
.copy-button {
top: -16px;
right: -16px;
color: $lightgray;
background-color: transparent;
border: none;
&:hover {
color: $mediumgray;
}
}
$blue-grey-50: #ECEFF1;