istio.io/_sass/base/_common.scss

348 lines
5.8 KiB
SCSS

// This is a hack such that when we link to a fragment on a page, the page
// scrolls correctly in relation to the fixed header. Without this hack, the
// page scrolls with the fragment at the top of the page, below the header!
*[id]:before {
display: block;
content: ' ';
margin-top: -3.0em;
height: 3.0em;
visibility: hidden;
}
// This is here to undo the effect of the above for table rows. Otherwise,
// table rows with ids don't render properly
tr[id]:before {
content: normal;
}
html {
overflow-y: scroll;
position: relative;
min-height: 100%;
}
body {
padding-top: $headerHeight-xs;
margin-bottom: $footerHeight-xs;
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: $textColor;
background-color: $backgroundColor;
@media (min-height: $bp-md-v) {
padding-top: $headerHeight;
}
@media (min-width: $bp-sm) {
margin-bottom: $footerHeight;
}
}
a {
color: $linkColor;
text-decoration: none;
font-weight: $linkWeight;
}
a:hover, a:focus {
color: $linkHoverColor;
text-decoration: underline;
font-weight: $linkWeight;
}
a.disabled {
color: $linkDisabledColor;
text-decoration: none;
font-weight: $linkWeight;
}
a.active {
color: $linkActiveColor;
text-decoration: none;
font-weight: $linkWeight;
}
table, th, td, tr {
padding: .5em;
}
table {
margin-left: 1em;
margin-right: 1em;
}
table p:first-of-type {
margin-top: 0
}
table p:last-of-type {
margin-bottom: 0
}
th {
color: $textBrandColor;
background-color: $secondBrandColor;
font-weight: $tableHeaderWeight;
}
tr.oneof>td {
border-bottom: 1px dashed $dividerBarColor;
border-top: 1px dashed $dividerBarColor;
}
table {
border-collapse: separate;
border-spacing: 0;
}
th, td {
border-left: 1px solid $boxBorderColor;
border-top: 1px solid $boxBorderColor;
}
tr:first-child th:first-child {
border-radius: 4px 0 0 0;
}
tr:first-child td:first-child {
border-radius: 4px 0 0 0;
}
tr:first-child th:last-child {
border-radius: 0 4px 0 0;
}
tr:first-child td:last-child {
border-radius: 0 4px 0 0;
}
tr:last-child td {
border-bottom: 1px solid $boxBorderColor;
}
tr:last-child td:first-child {
border-radius: 0 0 0 4px;
}
tr:last-child td:last-child {
border-radius: 0 0 4px 0;
}
tr th:last-child {
border-right: 1px solid $boxBorderColor;
}
tr td:last-child {
border-right: 1px solid $boxBorderColor;
}
thead+tbody tr:first-child td:first-child {
border-radius: 0;
}
thead+tbody tr:first-child td:last-child {
border-radius: 0;
}
pre {
margin: 1em;
max-height: 31em;
border: 1px solid $codeBlockBorderColor;
border-left: 5px solid $codeBlockBorderColor;
border-radius: 4px;
box-shadow: 3px 3px 8px $codeBlockShadowColor;
code {
display: block;
padding: .5em;
}
}
div.highlight {
position: relative;
}
button.copy {
font-size: .8em;
padding: 0 .5em;
border-radius: .3em;
background-color: $secondBrandColor;
cursor: pointer;
color: $textBrandColor;
text-decoration: none;
border: 0;
position: absolute;
top: 3px;
right: 1.3em;
z-index: 5;
}
button.copy-hide {
transition: opacity .4s ease-in-out;
opacity: 0;
}
button.copy-show {
transition: opacity 1.2s ease-in-out;
opacity: 1;
}
p {
font-size: $font-size--xs;
font-weight: $textWeight;
line-height: 1.5;
margin: .25em 0;
@media (min-width: $bp-md) {
margin: 1.5em 0;
}
}
li, dt, dd {
font-size: $font-size--xs;
font-weight: $textWeight;
line-height: 1.5;
margin: .25em;
}
ol, ul, dl {
list-style: initial;
font-size: $font-size--primary;
font-weight: $textWeight;
margin: 0 0 0 1.5em;
padding: 0;
}
li p, dt p, dd p {
margin: .4em 0;
}
ol {
list-style: decimal;
}
h1, h2, h3, h4, h5, h6 {
border: 0;
}
h1 {
font-size: $font-size--xxl;
color: $h1Color;
font-weight: $h1Weight;
margin: 30px 0;
}
h2 {
font-size: $font-size--xl;
color: $h2Color;
font-weight: $h2Weight;
margin-bottom: 20px;
margin-top: 30px;
padding-bottom: 10px;
border-bottom: 1px solid $h2UnderlineColor;
}
h3 {
font-size: $font-size--l;
color: $h3Color;
font-weight: $h3Weight;
letter-spacing: 1px;
margin-bottom: 20px;
margin-top: 30px;
}
h4 {
font-size: $font-size--l;
color: $h4Color;
font-weight: $h4Weight;
margin: 30px 0 20px;
// Text immediately following h4 should have same level of indention
+ p {
margin: 10px 0;
@media (max-width: 768px) {
margin: 5px 0;
}
}
}
h5 {
font-size: $font-size--s;
color: $h5Color;
font-weight: $h5Weight;
}
h6 {
font-size: .9rem;
color: $h6Color;
font-weight: $h6Weight;
}
.header-link {
position: relative;
left: 0.5em;
top: -.1em;
opacity: 0;
font-size: 0.6em;
}
h2:hover .header-link,
h3:hover .header-link,
h4:hover .header-link,
h5:hover .header-link,
h6:hover .header-link,
dt:hover .header-link {
transition: opacity .4s ease-in-out;
opacity: 1;
}
em {
font-style: italic;
}
strong {
font-weight: $boldTextWeight;
}
img {
width: 100%;
}
blockquote {
display: block;
margin: 1em 3em;
padding-left: 1em;
padding-right: 1em;
background-color: $blockQuoteBackgroundColor;
border-radius: 4px 4px 4px 4px;
}
code {
color: $textCodeColor;
font-size: 80%;
font-weight: $textCodeWeight;
word-break: normal;
}
.spacer {
height: .1rem;
@media (min-width: $bp-md) {
height: 1rem;
}
}
.deprecated {
background: $deprecatedBackgroundColor;
}
.card {
background-color: $backgroundColor;
border-color: $dividerBarColor;
}
.card-header {
border-bottom-color: $dividerBarColor;
}