Corrected BEM nesting depths

This commit is contained in:
squidfunk 2016-09-13 20:58:28 +02:00
parent 0111478b65
commit b387f2abee
10 changed files with 176 additions and 129 deletions

View File

@ -71,7 +71,7 @@ rules:
- break-at-device - break-at-device
- break-from-device - break-from-device
- break-to-device - break-to-device
nesting-depth: 0 nesting-depth: 2
no-color-keywords: 2 no-color-keywords: 2
no-color-literals: 2 no-color-literals: 2
no-css-comments: 2 no-css-comments: 2

View File

@ -55,8 +55,6 @@ $break-devices: (
// Primary and accent colors // Primary and accent colors
$md-color-primary: $clr-indigo-500; $md-color-primary: $clr-indigo-500;
$md-color-primary--light: $clr-indigo-100;
$md-color-primary--dark: $clr-indigo-700;
$md-color-accent: $clr-indigo-a200; $md-color-accent: $clr-indigo-a200;
// Shades of black // Shades of black

View File

@ -24,17 +24,26 @@
// Nothing to see here, move along // Nothing to see here, move along
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
.md-search__suggest { .md-search__suggest {
@include z-depth(8);
background: $md-color-white; background: $md-color-white;
border-radius: 0 0 px2rem(3px) px2rem(3px); border-radius: 0 0 px2rem(3px) px2rem(3px);
color: #000000; color: #000000;
text-align: left; text-align: left;
border-top: px2rem(1px) solid $md-color-black--lightest; border-top: px2rem(1px) solid $md-color-black--lightest;
display: none; display: none; // TODO: doesnt work due to display: none;
opacity: 0;
// overflow: auto;
transition: opacity .3s;
// pointer-events: none;
.md-search__input:focus ~ & { .md-search__input:focus ~ & {
// animation: anima .3s;
display: block; display: block;
opacity: 1;
} }
} }
@ -67,6 +76,10 @@
} }
} }
.md-search-term {
}
.checklist { .checklist {
li { li {
@ -163,21 +176,13 @@ mark {
} }
} }
article { .md-button {
overflow: auto;
}
.floater {
display: none;
float: right; float: right;
margin-top: 9px; margin-top: 9px;
font-size: 13px; font-size: 13px;
padding-left: 2.6rem; padding-left: 2.6rem;
font-weight: 700;
&::before { text-transform: uppercase;
@extend %md-icon;
content: "edit";
}
} }
.task-list-item { .task-list-item {
@ -188,9 +193,9 @@ article {
margin: 0 4px 0.25em -20px; margin: 0 4px 0.25em -20px;
vertical-align: middle; vertical-align: middle;
} }
//
//
//
.task-list-item { .task-list-item {
position: relative; position: relative;
} }
@ -221,3 +226,11 @@ article {
content: ""; content: "";
color: #1EBB52; color: #1EBB52;
} }
.codehilite .hll {
background: #FFFF00;
display: block;
margin: 0 -16px;
padding: 0 16px;
}

View File

@ -169,6 +169,7 @@ code {
pre { pre {
margin: 2.0rem 0; margin: 2.0rem 0;
padding: 1.0rem 1.2rem; padding: 1.0rem 1.2rem;
border-radius: 0.2rem;
background: #F7F7F7; background: #F7F7F7;
color: #37474F; color: #37474F;
font-size: 85%; font-size: 85%;

View File

@ -30,17 +30,17 @@
/// @example /// @example
/// $break-devices: ( /// $break-devices: (
/// mobile: ( /// mobile: (
/// portrait: px2em(220px) px2em(479px), /// portrait: 220px 479px,
/// landscape: px2em(480px) px2em(719px) /// landscape: 480px 719px
/// ), /// ),
/// tablet: ( /// tablet: (
/// portrait: px2em(720px) px2em(959px), /// portrait: 720px 959px,
/// landscape: px2em(960px) px2em(1199px) /// landscape: 960px 1199px
/// ), /// ),
/// screen: ( /// screen: (
/// small: px2em(1200px) px2em(1599px), /// small: 1200px 1599px,
/// medium: px2em(1600px) px2em(1999px), /// medium: 1600px 1999px,
/// large: px2em(2000px) /// large: 2000px
/// ) /// )
/// ); /// );
/// ///

View File

@ -41,6 +41,9 @@
&__inner { &__inner {
margin: 2.4rem 1.6rem; margin: 2.4rem 1.6rem;
// Hack: this is necessary for floating the edit button
overflow: auto;
// [screen small +]: Add space for table of contents // [screen small +]: Add space for table of contents
@include break-from-device(screen small) { @include break-from-device(screen small) {
margin: 2.4rem; margin: 2.4rem;

View File

@ -29,15 +29,16 @@
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
}
// Pagination container // Pagination container
&-pagination { .md-footer-pagination {
background: $md-color-black; background: $md-color-black;
color: $md-color-white; color: $md-color-white;
} }
// Footer navigation // Footer navigation
&-nav { .md-footer-nav {
padding: 0.4rem; padding: 0.4rem;
overflow: auto; overflow: auto;
@ -109,4 +110,3 @@
font-size: 1.5rem; font-size: 1.5rem;
} }
} }
}

View File

@ -36,9 +36,10 @@
background: $md-color-primary; background: $md-color-primary;
color: $md-color-white; color: $md-color-white;
z-index: 1; z-index: 1;
}
// Navigation within header // Navigation within header
&-nav { .md-header-nav {
padding: 0.4rem; padding: 0.4rem;
// Header icon // Header icon
@ -74,4 +75,3 @@
line-height: 4.8rem; line-height: 4.8rem;
} }
} }
}

View File

@ -67,6 +67,7 @@
// [tablet +]: Header-embedded search // [tablet +]: Header-embedded search
@include break-from-device(tablet) { @include break-from-device(tablet) {
padding: 0.4rem; padding: 0.4rem;
padding-right: 3.2rem;
} }
} }
@ -106,6 +107,7 @@
&__input { &__input {
padding: 0 0.8rem 0 6.4rem; padding: 0 0.8rem 0 6.4rem;
border-radius: px2rem(2px); border-radius: px2rem(2px);
text-overflow: ellipsis;
// Placeholder and icon color in active state // Placeholder and icon color in active state
+ .md-search__icon, + .md-search__icon,
@ -128,7 +130,7 @@
transition: width 0.25s cubic-bezier(0.1, 0.7, 0.1, 1.0), transition: width 0.25s cubic-bezier(0.1, 0.7, 0.1, 1.0),
background-color 0.25s, background-color 0.25s,
color 0.25s; color 0.25s;
background: $md-color-white--lightest; background: $md-color-black--lighter;
color: $md-color-white; color: $md-color-white;
font-size: ms(0); font-size: ms(0);
@ -141,14 +143,15 @@
// Hovered search field // Hovered search field
&:hover { &:hover {
background: $md-color-white--lighter; background: $md-color-white--lightest;
} }
// Active search field // Active search field
&:focus { &:focus {
width: 72.8rem; width: 66.8rem;
background: $md-color-white; background: $md-color-white;
color: $md-color-black; color: $md-color-black;
text-overflow: none;
// Placeholder and icon color in active state // Placeholder and icon color in active state
+ .md-search__icon, + .md-search__icon,

View File

@ -34,7 +34,7 @@
padding: 0 1.2rem; padding: 0 1.2rem;
transition: opacity 0.25s; transition: opacity 0.25s;
font-size: 1.3rem; font-size: 1.3rem;
line-height: 1.4; line-height: 1.2;
white-space: nowrap; white-space: nowrap;
vertical-align: middle; vertical-align: middle;
@ -86,10 +86,39 @@
overflow: hidden; overflow: hidden;
} }
// Repository statistics // Source facts (statistics etc.)
&__stats { &__facts {
margin: 0;
padding: 0;
color: $md-color-white--light; color: $md-color-white--light;
font-size: 1.1rem; font-size: 1.1rem;
font-weight: 700; font-weight: 700;
list-style-type: none;
}
// Fact
&__fact {
float: left;
transform: translateY(0%);
transition: opacity 0.25s,
transform 0.25s cubic-bezier(0.1, 0.7, 0.1, 1.0);
opacity: 1;
&--hidden {
transform: translateY(100%);
opacity: 0;
}
&::before {
margin: 0 0.2rem;
content: "\00B7";
}
&:first-child {
&::before {
display: none;
}
}
} }
} }