daux.io/themes/daux/scss/_components.scss

520 regels
10 KiB
SCSS

/* ============================================================================
2016-05-23 20:09:15 +02:00
Base tags
============================================================================ */
2016-05-23 20:09:15 +02:00
a {
text-decoration: none;
color: var(--link-color);
&.Link--external:after {
2019-05-28 22:12:50 +02:00
content: " "
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);
}
&.Link--broken {
color: red;
}
2016-05-23 20:09:15 +02:00
}
p {
margin: 0 0 1em;
}
hr {
clear: both;
margin: 1em 0;
border: 0;
border-top: 1px solid #ddd;
}
/* ============================================================================
Components
============================================================================ */
2014-02-16 12:28:06 +01:00
2016-05-23 20:09:15 +02:00
.Button {
display: inline-block;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
border: 1px solid transparent;
white-space: nowrap;
border-radius: 4px;
margin-bottom: 0;
2016-05-23 20:09:15 +02:00
&--small {
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
&--default {
color: #333;
background-color: #fff;
border-color: #ccc;
&.Button--active {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
}
}
.ButtonGroup {
position: relative;
display: inline-block;
2016-05-23 20:09:15 +02:00
vertical-align: middle; // match .Button alignment given font-size hack above
2016-05-23 20:09:15 +02:00
.Button + .Button {
margin-left: -1px;
}
2014-02-16 12:43:16 +01:00
2016-05-23 20:09:15 +02:00
> .Button {
position: relative;
float: left;
// Bring the "active" button to the front
&:hover,
&:focus {
z-index: 2;
2014-02-16 12:43:16 +01:00
}
2016-05-23 20:09:15 +02:00
&:active,
&.Button--active {
z-index: 3;
}
2014-02-16 12:43:16 +01:00
2016-05-23 20:09:15 +02:00
&:not(:first-child):not(:last-child) {
border-radius: 0;
}
2018-09-20 21:05:22 +02:00
// Set corners individually because sometimes
// a single button can be in a .ButtonGroup
// and we need :first-child and :last-child to both match
2016-05-23 20:09:15 +02:00
&:first-child {
margin-left: 0;
}
&:first-child:not(:last-child) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
2014-02-16 12:43:16 +01:00
}
2016-05-23 20:09:15 +02:00
&:last-child:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
2016-05-23 20:09:15 +02:00
}
2014-02-16 12:43:16 +01:00
}
2014-02-16 12:28:06 +01:00
}
2014-02-16 12:43:16 +01:00
2017-02-23 23:15:07 +01:00
.Brand {
display: block;
background-color: var(--brand-background);
2018-02-26 22:46:36 +01:00
padding: 0.75em 0.6em;
font-size: var(--type-size-4);
2017-02-23 23:15:07 +01:00
text-shadow: none;
font-family: var(--font-family-heading);
2017-02-23 23:15:07 +01:00
font-weight: 700;
color: var(--brand-color);
2017-02-23 23:15:07 +01:00
}
2016-05-23 20:09:15 +02:00
.Navbar {
2017-02-23 23:15:07 +01:00
height: 50px;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
2018-02-26 22:46:36 +01:00
background-color: var(--homepage-navbar-background);
margin-bottom: 0;
2014-02-16 12:43:16 +01:00
2017-02-23 23:15:07 +01:00
.Brand {
2016-05-23 20:09:15 +02:00
float: left;
line-height: 20px;
2017-02-23 23:15:07 +01:00
height: 50px;
2014-02-16 12:43:16 +01:00
}
2014-02-16 12:28:06 +01:00
}
2016-05-23 20:09:15 +02:00
.CodeToggler {
2018-02-26 22:46:36 +01:00
padding: 0 20px;
2016-05-23 20:09:15 +02:00
&__text {
font-size: 12px;
line-height: 1.5;
padding: 6px 10px 6px 0;
display: inline-block;
vertical-align: middle;
}
2016-04-08 00:13:06 +02:00
}
.no-js .CodeToggler {
display: none;
}
2016-04-08 00:13:06 +02:00
2016-05-23 20:09:15 +02:00
// Sidebar navigation
.Nav {
margin: 0;
padding: 0;
&__arrow {
display: inline-block;
position: relative;
width: 16px;
margin-left: -16px;
&:before {
2016-05-23 20:09:15 +02:00
position: absolute;
display: block;
content: "";
margin: -0.25em 0 0 -0.4em;
left: 50%;
top: 50%;
width: 0.5em;
height: 0.5em;
border-right: 0.15em solid var(--sidebar-link-arrow-color);
border-top: 0.15em solid var(--sidebar-link-arrow-color);
2016-05-23 20:09:15 +02:00
transform: rotate(45deg);
transition-duration: 0.3s;
}
}
&__item {
display: block;
2014-02-16 12:43:16 +01:00
a {
2016-05-23 20:09:15 +02:00
display: block;
margin: 0;
padding: 6px 15px 6px 20px;
font-family: var(--font-family-heading);
2016-05-23 20:09:15 +02:00
font-weight: 400;
color: var(--sidebar-link-color);
2014-02-16 12:43:16 +01:00
text-shadow: none;
}
2014-02-16 12:43:16 +01:00
a:hover {
color: var(--sidebar-link-color);
text-shadow: none;
background-color: var(--sidebar-link-hover-background);
2014-02-16 12:43:16 +01:00
}
2016-05-23 20:09:15 +02:00
}
}
2014-02-16 12:43:16 +01:00
.Nav .Nav {
margin-left: 15px;
html:not(.no-js) & {
height: 0;
transition: height 400ms ease-in-out;
overflow: hidden;
}
.Nav__item a {
margin: 0;
margin-left: -15px;
padding: 3px 30px;
font-family: var(--font-family-text);
color: var(--sidebar-link-secondary-color);
opacity: 0.7;
&:hover {
opacity: 1;
2016-05-23 20:09:15 +02:00
}
}
2014-02-16 12:43:16 +01:00
.Nav__item--active a {
color: var(--sidebar-link-color);
}
}
.Nav__item {
&--open,
&--active {
> a {
background-color: var(--sidebar-link-active-background);
2014-02-16 12:43:16 +01:00
}
}
2014-02-16 12:43:16 +01:00
&--open {
> a > .Nav__arrow:before {
margin-left: -0.25em;
transform: rotate(135deg);
2014-02-16 12:43:16 +01:00
}
}
2014-02-16 12:28:06 +01:00
}
2016-05-23 20:09:15 +02:00
.Page__header {
margin: 0 0 10px;
padding: 0;
2016-05-23 20:09:15 +02:00
border-bottom: 1px solid #eee;
@include clearfix();
2014-02-16 12:43:16 +01:00
h1 {
margin: 0;
padding: 0;
2017-02-23 23:15:07 +01:00
line-height: 57px;
2014-02-16 12:43:16 +01:00
}
2016-05-23 20:09:15 +02:00
&--separator {
height: 0.6em;
}
a {
text-decoration: none;
2014-02-16 12:43:16 +01:00
}
.ModifiedDate {
float: left;
font-size: 10px;
color: gray;
}
.EditOn {
float: right;
font-size: 10px;
color: gray;
}
2014-02-16 12:28:06 +01:00
}
2016-05-23 20:09:15 +02:00
.Links {
padding: 0 20px;
2014-02-16 12:28:06 +01:00
a {
font-family: var(--font-family-heading);
2016-05-23 20:09:15 +02:00
font-weight: 400;
color: var(--sidebar-link-color);
2016-05-23 20:09:15 +02:00
line-height: 2em;
2014-02-16 12:43:16 +01:00
}
}
2016-03-13 21:51:58 +01:00
2018-02-26 22:46:36 +01:00
.Twitter {
padding: 0 20px;
}
2018-02-27 22:47:07 +01:00
.PoweredBy {
padding: 0 20px 1rem 20px;
2018-02-27 22:47:07 +01:00
font-size: var(--type-size-6);
}
2016-05-23 20:09:15 +02:00
.Search {
2016-03-13 21:51:58 +01:00
position: relative;
&__field {
2016-05-23 20:09:15 +02:00
display: block;
width: 100%;
height: 34px;
2017-02-23 23:15:07 +01:00
padding: 6px 30px 6px 20px;
color: var(--search-field-color);
2017-02-23 23:15:07 +01:00
border-width: 0 0 1px;
border-bottom: 1px solid var(--search-field-border-color);
background: var(--search-field-background);
2017-02-23 23:15:07 +01:00
transition: border-color ease-in-out 0.15s;
2016-05-23 20:09:15 +02:00
&:focus {
border-color: var(--search-field-hover-border-color);
2016-05-23 20:09:15 +02:00
outline: 0;
}
2016-03-13 21:51:58 +01:00
}
&__icon {
position: absolute;
2016-05-23 20:09:15 +02:00
right: 9px;
top: 9px;
width: 16px;
height: 16px;
2016-03-13 21:51:58 +01:00
}
}
2016-04-12 08:38:52 +02:00
2017-02-23 23:15:07 +01:00
.Navbar .Search {
float: right;
margin: 8px 20px;
&__field {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
border-width: 0;
border-radius: 4px;
padding-left: 10px;
}
}
2017-12-11 21:14:18 +01:00
.TableOfContentsContainer {
&__title {
border-bottom: 4px solid #efefef;
margin-bottom: 0 !important;
}
&__content > .TableOfContents {
margin-top: 0;
}
}
ul.TableOfContents {
float: none;
font-size: 16px;
2017-12-11 21:14:18 +01:00
padding-left: 1.5em;
border-left: 6px solid #efefef;
2016-04-12 08:38:52 +02:00
p {
margin-bottom: 0;
2016-04-12 08:38:52 +02:00
}
2016-05-23 20:09:15 +02:00
a {
text-decoration: none;
}
2016-04-12 08:38:52 +02:00
.TableOfContents {
border-left-width: 0;
2016-05-23 20:09:15 +02:00
}
}
2017-12-11 21:14:18 +01:00
.Columns__right--full .TableOfContentsContainer {
float: right;
min-width: 300px;
max-width: 25%;
2018-02-26 22:46:36 +01:00
padding-left: 1em;
2017-12-11 21:14:18 +01:00
.TableOfContentsContainer__content > .TableOfContents {
border-right: 2px solid #efefef;
}
.TableOfContents {
list-style-type: none;
padding-left: 0;
}
a {
display: block;
border-bottom: 1px solid #ddd;
2018-02-26 22:46:36 +01:00
padding: 0.2em 0;
2017-12-11 21:14:18 +01:00
}
li a {
padding-left: 0.75em;
}
li li a {
padding-left: 1.5em;
}
li li li a {
padding-left: 2.25em;
}
2018-05-05 17:35:12 +02:00
// stylelint-disable-next-line selector-max-compound-selectors
2017-12-11 21:14:18 +01:00
li li li li a {
padding-left: 3em;
}
}
2016-05-23 20:09:15 +02:00
.Pager {
padding-left: 0;
margin: 1em 0;
list-style: none;
text-align: center;
clear: both;
@include clearfix();
2016-05-23 20:09:15 +02:00
li {
display: inline;
> a {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 15px;
}
> a:hover,
> a:focus {
text-decoration: none;
background-color: #eee;
}
}
&--next > a {
float: right;
}
&--prev > a {
float: left;
2016-04-12 08:38:52 +02:00
}
}
2017-10-19 21:20:58 +02:00
.Checkbox {
position: relative;
display: block;
padding-left: 30px;
cursor: pointer;
input {
position: absolute;
z-index: -1;
opacity: 0;
}
}
.Checkbox__indicator {
position: absolute;
2018-02-26 22:46:36 +01:00
top: 50%;
2017-10-19 21:20:58 +02:00
left: 0;
width: 20px;
height: 20px;
2018-02-26 22:46:36 +01:00
margin-top: -10px;
background: var(--checkbox-background);
2017-10-19 21:20:58 +02:00
/* Check mark */
&:after {
2017-10-19 21:20:58 +02:00
position: absolute;
display: none;
content: "";
2017-10-19 21:20:58 +02:00
}
/* Hover and focus states */
.Checkbox:hover input ~ &,
.Checkbox input:focus ~ & {
background: var(--checkbox-hover-background);
2017-10-19 21:20:58 +02:00
}
/* Checked state */
.Checkbox input:checked ~ & {
background: var(--checkbox-checked-background);
2017-10-19 21:20:58 +02:00
/* Show check mark */
&:after {
2017-10-19 21:20:58 +02:00
display: block;
}
}
/* Hover state whilst checked */
2019-05-28 22:12:50 +02:00
.Checkbox:hover input:not([disabled]):checked ~ &,
.Checkbox input:checked:focus ~ & {
background: var(--checkbox-checked-hover-background);
2017-10-19 21:20:58 +02:00
}
/* Disabled state */
.Checkbox input:disabled ~ & {
pointer-events: none;
opacity: 0.6;
background: var(--checkbox-disabled-background);
2017-10-19 21:20:58 +02:00
}
/* Checkbox tick */
.Checkbox &:after {
2017-10-19 21:20:58 +02:00
top: 4px;
left: 8px;
width: 5px;
height: 10px;
transform: rotate(45deg);
border: solid var(--checkbox-tick-color);
2017-10-19 21:20:58 +02:00
border-width: 0 2px 2px 0;
}
/* Disabled tick colour */
.Checkbox input:disabled ~ &:after {
border-color: var(--checkbox-disabled-tick-color);
2017-10-19 21:20:58 +02:00
}
}
2018-02-26 22:46:36 +01:00
.Hidden {
display: none;
}