soapbox/app/styles/forms.scss

834 wiersze
14 KiB
SCSS
Czysty Zwykły widok Historia

2020-03-27 20:59:38 +00:00
$no-columns-breakpoint: 600px;
code {
2020-06-02 22:42:09 +00:00
font-family: var(--font-monospace), monospace;
2020-03-27 20:59:38 +00:00
font-weight: 400;
}
.form-container {
max-width: 400px;
padding: 20px;
margin: 0 auto;
}
.simple_form {
.input {
2020-09-28 05:01:36 +00:00
margin-bottom: 8px;
2020-03-27 20:59:38 +00:00
overflow: hidden;
&.hidden {
margin: 0;
}
&.radio_buttons {
.radio {
margin-bottom: 15px;
&:last-child {
margin-bottom: 0;
}
}
.radio > label {
position: relative;
padding-left: 28px;
input {
position: absolute;
top: -2px;
left: 0;
}
}
}
&.boolean {
position: relative;
.label_input > label {
font-family: inherit;
font-size: 14px;
padding-top: 5px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
display: block;
width: auto;
}
.label_input,
.hint {
padding-left: 28px;
}
.label_input__wrapper {
position: static;
}
2020-04-23 00:09:40 +00:00
input[type="checkbox"] {
2020-03-27 20:59:38 +00:00
position: absolute;
2020-04-23 00:09:40 +00:00
top: 3px;
2020-03-27 20:59:38 +00:00
left: 0;
}
label a {
2020-05-31 02:48:37 +00:00
color: var(--highlight-text-color);
2020-03-27 20:59:38 +00:00
text-decoration: underline;
&:hover,
&:active,
&:focus {
text-decoration: none;
}
}
}
}
.row {
display: flex;
margin: 0 -5px;
.input {
box-sizing: border-box;
flex: 1 1 auto;
width: 50%;
padding: 0 5px;
}
}
.hint {
2020-06-07 03:55:00 +00:00
color: var(--primary-text-color--faint);
2020-03-27 20:59:38 +00:00
a {
2020-05-31 02:48:37 +00:00
color: var(--highlight-text-color);
2020-03-27 20:59:38 +00:00
}
code {
border-radius: 3px;
padding: 0.2em 0.4em;
2020-06-02 22:42:09 +00:00
background: var(--background-color);
2020-03-27 20:59:38 +00:00
}
}
span.hint {
display: block;
font-size: 12px;
}
p.hint {
margin-bottom: 15px;
2020-06-07 03:55:00 +00:00
color: var(--primary-text-color--faint);
2020-03-27 20:59:38 +00:00
&.subtle-hint {
text-align: center;
font-size: 12px;
line-height: 18px;
margin-top: 15px;
margin-bottom: 0;
}
}
.card {
margin-bottom: 15px;
}
strong {
font-weight: 500;
@each $lang in $cjk-langs {
&:lang(#{$lang}) {
font-weight: 700;
}
}
}
.input.with_floating_label {
.label_input {
display: flex;
& > label {
font-family: inherit;
font-size: 14px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
font-weight: 500;
min-width: 150px;
flex: 0 0 auto;
}
input,
select {
flex: 1 1 auto;
}
}
&.select .hint {
margin-top: 6px;
margin-left: 150px;
}
}
.input.with_label {
.label_input > label {
font-family: inherit;
font-size: 14px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
display: block;
word-wrap: break-word;
font-weight: 500;
}
ul {
flex: 390px;
}
}
2020-10-16 16:55:35 +00:00
.input.font_icon_picker {
width: 52px;
}
2020-03-27 20:59:38 +00:00
.input.with_block_label {
max-width: none;
& > label {
font-family: inherit;
font-size: 16px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
display: block;
font-weight: 500;
padding-top: 5px;
}
.hint {
margin-bottom: 15px;
}
ul {
columns: 2;
}
}
.required abbr {
text-decoration: none;
color: lighten($error-value-color, 12%);
}
.fields-group {
margin-bottom: 25px;
.input:last-child {
margin-bottom: 0;
}
}
.fields-row {
display: flex;
margin: 0 -10px;
padding-top: 5px;
margin-bottom: 25px;
.input {
max-width: none;
}
&__column {
box-sizing: border-box;
padding: 0 10px;
flex: 1 1 auto;
min-height: 1px;
&-6 {
max-width: 50%;
}
}
.fields-group:last-child,
.fields-row__column.fields-group {
margin-bottom: 0;
}
@media screen and (max-width: $no-columns-breakpoint) {
display: block;
margin-bottom: 0;
&__column {
max-width: none;
}
.fields-group:last-child,
.fields-row__column.fields-group,
.fields-row__column {
margin-bottom: 25px;
}
}
}
.input.radio_buttons .radio label {
margin-bottom: 5px;
font-family: inherit;
font-size: 14px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
display: block;
width: auto;
}
.check_boxes {
.checkbox {
label {
font-family: inherit;
font-size: 14px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
display: inline-block;
width: auto;
position: relative;
padding-top: 5px;
padding-left: 25px;
flex: 1 1 auto;
}
input[type=checkbox] {
position: absolute;
left: 0;
top: 5px;
margin: 0;
}
}
2020-04-11 00:03:06 +00:00
}
fieldset[disabled] {
input[type=text],
input[type=number],
input[type=email],
input[type=url],
2020-04-11 00:03:06 +00:00
input[type=password],
textarea {
2020-06-07 03:55:00 +00:00
color: var(--primary-text-color--faint);
border-color: var(--primary-text-color--faint);
2020-04-11 00:03:06 +00:00
}
2020-03-27 20:59:38 +00:00
}
input[type=text],
input[type=number],
input[type=email],
input[type=url],
2020-03-27 20:59:38 +00:00
input[type=password],
textarea,
.rfipbtn {
2020-03-27 20:59:38 +00:00
box-sizing: border-box;
font-size: 16px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
display: block;
width: 100%;
outline: 0;
font-family: inherit;
resize: vertical;
background-color: var(--background-color);
2020-06-02 04:24:36 +00:00
border: 1px solid var(--highlight-text-color);
2020-03-27 20:59:38 +00:00
border-radius: 4px;
padding: 10px;
2020-06-02 00:53:22 +00:00
transition: 0.2s;
2020-03-27 20:59:38 +00:00
&:invalid {
box-shadow: none;
}
&:focus:invalid:not(:placeholder-shown) {
border-color: lighten($error-red, 12%);
}
&:required:valid {
border-color: $valid-value-color;
}
&:active,
&:focus {
2020-06-07 03:55:00 +00:00
border-color: var(--brand-color--hicontrast);
2020-03-27 20:59:38 +00:00
}
}
.rfip {
width: 100%;
margin: 0;
}
input[type=text][disabled],
input[type=number][disabled],
input[type=email][disabled],
input[type=url][disabled],
input[type=password][disabled],
2020-08-09 20:13:36 +00:00
textarea[disabled] {
color: var(--primary-text-color--faint);
border-color: var(--primary-text-color--faint);
}
2020-03-27 20:59:38 +00:00
.input.field_with_errors {
label {
color: lighten($error-red, 12%);
}
input[type=text],
input[type=number],
input[type=email],
input[type=url],
2020-03-27 20:59:38 +00:00
input[type=password],
textarea,
select {
border-color: lighten($error-red, 12%);
}
}
2020-03-27 20:59:38 +00:00
.error {
display: block;
font-weight: 500;
color: lighten($error-red, 12%);
margin-top: 4px;
2020-03-27 20:59:38 +00:00
}
.input.disabled {
opacity: 0.5;
}
.actions {
margin-top: 30px;
display: flex;
&.actions--top {
margin-top: 0;
margin-bottom: 30px;
}
}
button,
.button,
.block-button,
.color-swatch {
2020-03-27 20:59:38 +00:00
display: block;
width: 100%;
border: 0;
border-radius: 4px;
2020-05-31 22:34:33 +00:00
background: var(--brand-color);
2020-06-01 02:05:00 +00:00
color: #fff;
2020-03-27 20:59:38 +00:00
font-size: 18px;
line-height: inherit;
height: auto;
padding: 10px;
text-transform: uppercase;
text-decoration: none;
text-align: center;
box-sizing: border-box;
cursor: pointer;
font-weight: 500;
outline: 0;
margin-bottom: 10px;
margin-right: 10px;
&:last-child {
margin-right: 0;
}
2020-06-01 00:22:08 +00:00
&:hover,
2020-03-27 20:59:38 +00:00
&:active,
&:focus {
2020-06-07 03:55:00 +00:00
background-color: var(--brand-color--hicontrast);
2020-03-27 20:59:38 +00:00
}
&.negative {
background: $error-value-color;
&:hover {
background-color: lighten($error-value-color, 5%);
}
&:active,
&:focus {
background-color: darken($error-value-color, 5%);
}
}
&.accordion__toggle {
display: inline-block;
width: auto;
border: 0;
border-radius: 0;
background: none;
color: var(--primary-text-color--faint);
font-size: 18px;
line-height: inherit;
height: auto;
padding: 0 10px;
text-transform: none;
text-decoration: none;
text-align: center;
box-sizing: border-box;
cursor: pointer;
font-weight: 500;
outline: 0;
margin-bottom: 0;
margin-right: 10px;
}
2020-03-27 20:59:38 +00:00
}
select {
2020-09-28 05:57:31 +00:00
appearance: none;
2020-03-27 20:59:38 +00:00
box-sizing: border-box;
font-size: 16px;
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-06-03 01:12:36 +00:00
background: var(--background-color);
2020-03-27 20:59:38 +00:00
display: block;
width: 100%;
outline: 0;
font-family: inherit;
resize: vertical;
2020-06-03 01:12:36 +00:00
border: 1px solid var(--highlight-text-color);
2020-03-27 20:59:38 +00:00
border-radius: 4px;
padding-left: 10px;
padding-right: 30px;
height: 41px;
2020-06-03 01:12:36 +00:00
position: relative;
2020-09-28 05:57:31 +00:00
margin-top: 8px;
cursor: pointer;
&:focus {
background: var(--accent-color--faint);
}
2020-09-28 05:57:31 +00:00
}
2020-10-02 02:04:00 +00:00
.select-wrapper {
display: flex;
align-items: center;
&::after {
display: flex;
align-items: center;
font-family: "ForkAwesome";
content: "";
position: absolute;
right: 12px;
height: calc(100% - 8px);
padding-left: 12px;
pointer-events: none;
margin-top: 8px;
}
2020-03-27 20:59:38 +00:00
}
.label_input {
2020-08-02 20:41:26 +00:00
&__color {
display: inline-flex;
font-size: 14px;
.color-swatch {
width: 32px;
height: 16px;
margin-left: 12px;
}
}
2020-10-16 16:55:35 +00:00
&__font_icon_picker {
font-size: 14px;
2020-10-16 16:55:35 +00:00
.font-icon-button {
padding: 9px;
border: 1px solid var(--highlight-text-color);
border-radius: 4px;
cursor: pointer;
outline: none;
2021-07-10 06:40:00 +00:00
display: flex;
align-items: center;
justify-content: center;
height: 41px;
box-sizing: border-box;
2020-09-09 22:47:53 +00:00
2020-10-16 16:55:35 +00:00
.fa {
font-size: 18px;
2020-09-09 22:47:53 +00:00
color: var(--primary-text-color);
}
}
}
2020-03-27 20:59:38 +00:00
&__wrapper {
position: relative;
}
&__append {
position: absolute;
right: 3px;
top: 1px;
padding: 10px;
padding-bottom: 9px;
font-size: 16px;
2020-06-02 22:42:09 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
font-family: inherit;
pointer-events: none;
cursor: default;
max-width: 140px;
white-space: nowrap;
overflow: hidden;
&::after {
content: '';
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 1px;
width: 5px;
2020-06-07 03:55:00 +00:00
background-image: linear-gradient(to right, hsla(var(--background-color_hsl), 0), var(--background-color));
2020-03-27 20:59:38 +00:00
}
}
}
&__overlay-area {
position: relative;
&__overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
2020-06-02 22:42:09 +00:00
background: var(--background-color);
2020-03-27 20:59:38 +00:00
backdrop-filter: blur(2px);
border-radius: 4px;
&__content {
text-align: center;
&.rich-formatting {
&,
p {
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
}
}
}
}
}
2020-06-05 21:24:07 +00:00
h2 {
font-size: 20px;
line-height: normal;
margin-bottom: 14px;
font-weight: bold;
}
2020-03-27 20:59:38 +00:00
}
.block-icon {
display: block;
margin: 0 auto;
margin-bottom: 10px;
font-size: 24px;
}
.qr-code {
flex: 0 0 auto;
2020-06-02 23:31:55 +00:00
background: var(--foreground-color);
2020-03-27 20:59:38 +00:00
padding: 4px;
margin: 0 10px 20px 0;
box-shadow: 0 0 15px rgba($base-shadow-color, 0.2);
display: inline-block;
svg {
display: block;
margin: 0;
}
}
2020-09-28 03:48:21 +00:00
.simple_form {
2020-03-27 20:59:38 +00:00
.warning {
box-sizing: border-box;
background: rgba($error-value-color, 0.5);
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
text-shadow: 1px 1px 0 rgba($base-shadow-color, 0.3);
box-shadow: 0 2px 6px rgba($base-shadow-color, 0.4);
border-radius: 4px;
padding: 10px;
margin-bottom: 15px;
a {
2020-05-31 23:44:20 +00:00
color: var(--primary-text-color);
2020-03-27 20:59:38 +00:00
text-decoration: underline;
&:hover,
&:focus,
&:active {
text-decoration: none;
}
}
strong {
font-weight: 600;
display: block;
margin-bottom: 5px;
@each $lang in $cjk-langs {
&:lang(#{$lang}) {
font-weight: 700;
}
}
.fa {
font-weight: 400;
}
}
}
}
2020-04-20 21:17:51 +00:00
.columns-area {
form.simple_form {
padding: 15px;
}
}
2020-04-24 01:48:25 +00:00
.captcha {
background-color: #fff;
border-radius: 4px;
2020-04-24 01:48:25 +00:00
img {
display: table;
margin: 0 auto;
}
input[type="text"] {
border-radius: 0 0 4px 4px;
}
2020-04-24 01:48:25 +00:00
}
2020-06-05 21:24:07 +00:00
.authtokens {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
grid-gap: 20px;
}
.authtoken {
&__app-name {
font-size: 16px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
}
&__valid-until {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
}
&__revoke {
margin-top: 10px;
}
}
.file-picker img {
max-width: 100px;
max-height: 100px;
}
2020-08-24 04:19:56 +00:00
2020-10-01 20:18:52 +00:00
.code-editor {
textarea {
font-family: monospace;
white-space: pre;
}
2020-08-24 04:45:17 +00:00
2020-10-01 20:18:52 +00:00
&--invalid textarea {
border-color: $error-red !important;
color: $error-red;
}
.input {
margin-bottom: 0;
}
.hint {
margin-top: 10px;
}
2020-08-24 04:45:17 +00:00
}
.input .row > .fa-times-circle {
position: absolute;
right: 15px;
cursor: pointer;
color: $error-red;
transform: translateY(-9px);
}
.input .row > .input.with_label + .fa-times-circle {
right: 7px;
2020-10-02 01:53:11 +00:00
transform: translateY(9px);
}
2020-10-01 23:57:11 +00:00
.site-preview {
border-radius: 4px;
overflow: hidden;
height: 164px;
border: 1px solid;
margin-bottom: 40px;
background: var(--background-color);
* {
z-index: 0;
}
a {
cursor: default;
}
.ui {
display: flex;
flex-direction: column;
padding: 0;
height: 100%;
}
.page {
align-items: center;
justify-content: center;
height: 100%;
}
}
2020-10-02 01:53:11 +00:00
.input.with_label.toggle .label_input {
display: flex;
font-size: 14px;
align-items: center;
.theme-toggle {
margin-left: 10px;
}
}
2020-10-02 02:48:24 +00:00
.actions.add-row {
margin: 10px 0 0;
.button {
border: 0;
background: transparent;
&:hover {
color: var(--primary-text-color);
}
}
}
2021-06-10 00:49:53 +00:00
.copyable-input {
display: flex;
align-items: center;
justify-content: center;
2021-06-11 15:00:44 +00:00
height: 38px;
2021-06-10 00:49:53 +00:00
input {
flex: 1;
font-size: 14px !important;
border-radius: 4px 0 0 4px !important;
2021-06-11 15:00:44 +00:00
height: 100%;
2021-06-10 00:49:53 +00:00
}
button {
width: auto;
font-size: 14px;
margin: 0;
border-radius: 0 4px 4px 0;
2021-06-11 15:00:44 +00:00
height: 100%;
display: flex;
align-items: center;
justify-content: center;
2021-06-10 00:49:53 +00:00
}
}