1
0
mirror of https://github.com/Chalarangelo/mini.css.git synced 2025-08-31 01:29:46 +02:00

Mixins for buttons

Added mixins for buttons, allowing for button variants to be added.
This commit is contained in:
Angelos Chalaris
2017-11-07 17:34:56 +02:00
parent 787caea845
commit a45ae848f8
8 changed files with 237 additions and 4 deletions

181
dist/mini-default.css vendored
View File

@@ -13,7 +13,7 @@
--fore-color: #111;
--secondary-fore-color: #444;
--back-color: #f8f8f8;
--secondary-back-color: #eee;
--secondary-back-color: #f0f0f0;
--blockquote-color: #f57c00;
--pre-color: #1565c0;
--border-color: #aaa;
@@ -30,6 +30,10 @@ html {
font-size: 16px;
}
a, b, del, em, i, ins, q, span, strong, u {
font-size: 1em;
}
html, * {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, sans-serif;
line-height: 1.5;
@@ -590,3 +594,178 @@ a:hover, a:focus {
order: 999;
}
}
/*
Definitions for forms and input elements.
*/
/* Input_control module CSS variable definitions */
:root {
--input-focus-color: #0288d1;
--input-invalid-color: #d32f2f;
--button-back-color: #e2e2e2;
--button-hover-back-color: #dcdcdc;
--button-fore-color: #212121;
--button-border-color: transparent;
--button-hover-border-color: transparent;
}
form {
background: var(--secondary-back-color);
border: 0.0625rem solid var(--secondary-border-color);
border-radius: var(--universal-border-radius);
margin: var(--universal-margin);
padding: calc(2 * var(--universal-padding)) var(--universal-padding);
}
fieldset {
border: 0.0625rem solid var(--secondary-border-color);
border-radius: var(--universal-border-radius);
margin: calc(var(--universal-margin) / 4);
padding: var(--universal-padding);
}
legend {
box-sizing: border-box;
display: table;
max-width: 100%;
white-space: normal;
font-weight: 700;
padding: calc(var(--universal-padding) / 2);
}
label {
padding: calc(var(--universal-padding) / 2) var(--universal-padding);
}
.input-group {
display: inline-block;
}
.input-group.fluid {
display: flex;
align-items: center;
justify-content: center;
}
.input-group.fluid > input {
flex-grow: 1;
flex-basis: 0px;
}
@media screen and (max-width: 767px) {
.input-group.fluid {
align-items: stretch;
flex-direction: column;
}
}
.input-group.vertical {
display: flex;
align-items: stretch;
flex-direction: column;
}
.input-group.vertical > input {
flex-grow: 1;
flex-basis: 0px;
}
[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
input:not([type]), [type="text"], [type="email"], [type="number"], [type="search"],
[type="password"], [type="url"], [type="tel"], textarea, select {
box-sizing: border-box;
background: var(--back-color);
color: var(--fore-color);
border: 0.0625rem solid var(--secondary-border-color);
border-radius: var(--universal-border-radius);
margin: calc(var(--universal-margin) / 2);
padding: var(--universal-padding) calc(1.5 * var(--universal-padding));
}
input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus, textarea:hover, textarea:focus, select:hover, select:focus {
border-color: var(--input-focus-color);
box-shadow: none;
}
input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid, textarea:invalid, textarea:focus:invalid, select:invalid, select:focus:invalid {
border-color: var(--input-invalid-color);
box-shadow: none;
}
input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly], textarea[readonly], select[readonly] {
background: var(--secondary-back-color);
}
select {
max-width: 100%;
}
option {
overflow: hidden;
text-overflow: ellipsis;
}
:placeholder-shown {
color: var(--fore-color);
}
::-ms-placeholder {
color: var(--fore-color);
opacity: 0.54;
}
button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
button, html [type="button"], [type="reset"], [type="submit"] {
-webkit-appearance: button;
}
button {
overflow: visible;
text-transform: none;
}
button, [type="button"], [type="submit"], [type="reset"],
a.button, label.button, .button,
a[role="button"], label[role="button"], [role="button"] {
display: inline-block;
background: var(--button-back-color);
color: var(--button-fore-color);
border: 0.0625rem solid var(--button-border-color);
border-radius: var(--universal-border-radius);
padding: var(--universal-padding) calc(1.5 * var(--universal-padding));
margin: var(--universal-margin);
text-decoration: none;
cursor: pointer;
transition: background 0.3s;
}
button:hover, button:focus, [type="button"]:hover, [type="button"]:focus, [type="submit"]:hover, [type="submit"]:focus, [type="reset"]:hover, [type="reset"]:focus,
a.button:hover,
a.button:focus, label.button:hover, label.button:focus, .button:hover, .button:focus,
a[role="button"]:hover,
a[role="button"]:focus, label[role="button"]:hover, label[role="button"]:focus, [role="button"]:hover, [role="button"]:focus {
background: var(--button-hover-back-color);
border-color: var(--button-hover-border-color);
}
input:disabled, input[disabled], textarea:disabled, textarea[disabled], select:disabled, select[disabled], button:disabled, button[disabled], .button:disabled, .button[disabled], [role="button"]:disabled, [role="button"][disabled] {
cursor: not-allowed;
opacity: 0.75;
}

File diff suppressed because one or more lines are too long