rebuild style for settings section
This commit is contained in:
parent
8bf7afddd2
commit
bd828e697c
11 changed files with 562 additions and 418 deletions
|
|
@ -279,115 +279,59 @@ input[type=number] {
|
|||
color: var(--color-txt);
|
||||
font-size: 1rem;
|
||||
padding-left: 0.5ch;
|
||||
padding-right: 0.5ch;
|
||||
}
|
||||
|
||||
.field {
|
||||
display: flex;
|
||||
input[type=number] {
|
||||
padding-left: 0.75ch;
|
||||
}
|
||||
.field label {
|
||||
font-weight: 600;
|
||||
color: var(--color-800);
|
||||
|
||||
select {
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
}
|
||||
.field .input-with-unit {
|
||||
|
||||
.input-with-unit {
|
||||
display: flex;
|
||||
gap: 0.3rem;
|
||||
align-items: center;
|
||||
gap: 0.5ch;
|
||||
}
|
||||
.field .unit-toggle {
|
||||
height: var(--input-h);
|
||||
.input-with-unit input[type=range] {
|
||||
flex-grow: 1;
|
||||
margin-right: 1ch;
|
||||
}
|
||||
.input-with-unit .number-input {
|
||||
--input-w: 4ch;
|
||||
flex-grow: 1;
|
||||
max-width: calc(var(--input-w) * 1.75);
|
||||
display: flex;
|
||||
gap: 0.3rem;
|
||||
align-items: center;
|
||||
}
|
||||
.field .input-with-color {
|
||||
width: 100%;
|
||||
.input-with-unit .number-input .number-input {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.field .input-with-color .clr-field {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: var(--input-h) 1fr;
|
||||
grid-gap: 1ch;
|
||||
.input-with-unit .number-input input[type=number] {
|
||||
width: var(--input-w);
|
||||
padding-right: calc(var(--input-w) * 0.5);
|
||||
}
|
||||
.field .input-with-color .clr-field button {
|
||||
grid-column: 1;
|
||||
position: relative;
|
||||
border-radius: var(--border-radius);
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.field .input-with-color .clr-field input {
|
||||
grid-column: 2;
|
||||
.input-with-unit .unit-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25ch;
|
||||
}
|
||||
|
||||
.field {
|
||||
display: grid;
|
||||
grid-template-columns: var(--label-w) 1fr;
|
||||
.field-checkbox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5ch;
|
||||
}
|
||||
.field label {
|
||||
align-self: center;
|
||||
.field-checkbox input[type=checkbox] {
|
||||
accent-color: var(--color-interface-800);
|
||||
}
|
||||
|
||||
.field-font {
|
||||
display: grid;
|
||||
grid-template-columns: var(--label-w) 1fr;
|
||||
grid-template-rows: var(--input-h) var(--input-h);
|
||||
}
|
||||
.field-font .field-font__options {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
}
|
||||
.field-font .field-font__options select {
|
||||
width: 100%;
|
||||
grid-column: span 2;
|
||||
}
|
||||
.field-font .field-checkbox {
|
||||
padding-top: var(--space-xs);
|
||||
}
|
||||
.field-font .field-checkbox label {
|
||||
font-weight: 400;
|
||||
margin-left: 0.75ch;
|
||||
color: var(--color-txt);
|
||||
}
|
||||
|
||||
.field-text-size input[type=number] {
|
||||
width: var(--input-w-small);
|
||||
padding-left: 0.75ch;
|
||||
}
|
||||
.field-text-size input[type=range] {
|
||||
flex-grow: 2;
|
||||
flex-shrink: 2;
|
||||
}
|
||||
|
||||
.field-margin,
|
||||
.field-size {
|
||||
display: inline-grid;
|
||||
width: calc(50% - 1ch);
|
||||
grid-template-columns: 6.5ch var(--input-w-small) 1fr;
|
||||
margin-bottom: var(--space-xs);
|
||||
}
|
||||
.field-margin input,
|
||||
.field-size input {
|
||||
width: var(--input-w-small);
|
||||
padding-left: 0.75ch;
|
||||
}
|
||||
.field-margin:nth-of-type(odd),
|
||||
.field-size:nth-of-type(odd) {
|
||||
margin-right: 2ch;
|
||||
}
|
||||
|
||||
.checkbox-field {
|
||||
margin: calc(var(--space-xs) * 2) 0;
|
||||
grid-template-columns: 3ch 1fr;
|
||||
}
|
||||
.checkbox-field input {
|
||||
justify-self: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.field--view-only {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
/* Label with CSS tooltip */
|
||||
/* Label with tooltip ---------------------------------------------- */
|
||||
.label-with-tooltip {
|
||||
-webkit-text-decoration: underline dotted 1px var(--color-200);
|
||||
text-decoration: underline dotted 1px var(--color-200);
|
||||
|
|
@ -418,6 +362,69 @@ input[type=number] {
|
|||
visibility: visible;
|
||||
}
|
||||
|
||||
.input-with-color {
|
||||
width: 100%;
|
||||
}
|
||||
.input-with-color .clr-field {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: var(--input-h) minmax(0, 1fr);
|
||||
grid-gap: 1ch;
|
||||
}
|
||||
.input-with-color .clr-field button {
|
||||
grid-column: 1;
|
||||
position: relative;
|
||||
border-radius: var(--border-radius);
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.input-with-color .clr-field input {
|
||||
grid-column: 2;
|
||||
}
|
||||
|
||||
input[type=range] {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
input[type=range]::-webkit-slider-runnable-track {
|
||||
height: 6px;
|
||||
background: linear-gradient(to right, var(--color-interface-400) var(--progress, 0%), var(--color-interface-200) var(--progress, 0%));
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
}
|
||||
input[type=range]::-moz-range-track {
|
||||
height: 6px;
|
||||
background: linear-gradient(to right, var(--color-interface-400) var(--progress, 0%), var(--color-interface-200) var(--progress, 0%));
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
}
|
||||
input[type=range]::-moz-range-progress {
|
||||
height: 6px;
|
||||
background: var(--color-interface-400);
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
}
|
||||
input[type=range]::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background: var(--color-interface-900);
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
input[type=range]::-moz-range-thumb {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background: var(--color-interface-900);
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
input[type=number]::-webkit-inner-spin-button,
|
||||
input[type=number]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
|
|
@ -460,35 +467,6 @@ input[type=number] {
|
|||
.number-input .spinner-buttons button:hover svg path {
|
||||
fill: var(--color-interface-900);
|
||||
}
|
||||
.settings__container {
|
||||
margin: var(--space-m) 0;
|
||||
}
|
||||
.settings__container h2 {
|
||||
margin-bottom: var(--space);
|
||||
font-weight: 600;
|
||||
font-size: 1.4rem;
|
||||
border-bottom: 1px solid var(--color-200);
|
||||
color: var(--color-800);
|
||||
}
|
||||
.settings__container .infos {
|
||||
font-size: 0.8rem;
|
||||
color: var(--color-interface-400);
|
||||
}
|
||||
|
||||
.setting__section:not(:last-child) {
|
||||
border-bottom: 1px solid var(--color-interface-100);
|
||||
}
|
||||
|
||||
.setting__section {
|
||||
padding: var(--space-xs) 0;
|
||||
}
|
||||
.setting__section h3 {
|
||||
margin-top: calc(var(--space-xs) * 1.5);
|
||||
margin-bottom: calc(var(--space-xs) * 2);
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unit-toggle button:not(.spinner-btn) {
|
||||
cursor: pointer;
|
||||
border: 1px solid var(--color-interface-400);
|
||||
|
|
@ -528,6 +506,42 @@ input[type=number] {
|
|||
background-color: var(--color-interface-100);
|
||||
}
|
||||
|
||||
.toggle-setting {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.toggle-setting + label {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 24px;
|
||||
height: 14px;
|
||||
background: #ccc;
|
||||
border-radius: 18px;
|
||||
transition: background 0.2s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
.toggle-setting + label::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: white;
|
||||
border-radius: 50%;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.toggle-setting:checked + label {
|
||||
background: var(--color-purple);
|
||||
}
|
||||
.toggle-setting:checked + label::after {
|
||||
transform: translateX(10px);
|
||||
}
|
||||
|
||||
.settings-popup {
|
||||
position: fixed;
|
||||
background: white;
|
||||
|
|
@ -535,15 +549,9 @@ input[type=number] {
|
|||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
||||
z-index: 10;
|
||||
width: 860px;
|
||||
height: 600px;
|
||||
min-width: 480px;
|
||||
max-width: 75vw;
|
||||
min-height: 250px;
|
||||
max-height: 70vh;
|
||||
max-height: 600px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
resize: both;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
|
|
@ -553,12 +561,6 @@ input[type=number] {
|
|||
padding: 0.75rem 1rem;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
background: #f9f9f9;
|
||||
cursor: grab;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.popup-header:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.header-left {
|
||||
|
|
@ -590,32 +592,6 @@ input[type=number] {
|
|||
background-color: var(--color-panel-bg);
|
||||
}
|
||||
|
||||
.setting__section h4 {
|
||||
margin: 0 0 0.5rem 0;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.inheritance-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 0.875rem;
|
||||
color: #666;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.inheritance-btn:hover {
|
||||
color: #333;
|
||||
}
|
||||
.inheritance-btn svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
.popup-css {
|
||||
flex: 1;
|
||||
background: #f5f5f5;
|
||||
|
|
@ -706,6 +682,89 @@ input[type=number] {
|
|||
outline: none;
|
||||
}
|
||||
|
||||
.setting__section {
|
||||
display: grid;
|
||||
grid-template-columns: 17ch 1fr;
|
||||
padding: var(--space-s) 0;
|
||||
}
|
||||
.setting__section:not(:last-child) {
|
||||
border-bottom: 1px solid var(--color-interface-100);
|
||||
}
|
||||
.setting__section .setting__header {
|
||||
height: var(--input-h);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1ch;
|
||||
align-self: start;
|
||||
}
|
||||
.setting__section .setting__header .label-with-tooltip {
|
||||
font-weight: bold;
|
||||
}
|
||||
.setting__section .info-default {
|
||||
font-size: 0.7rem;
|
||||
color: var(--color-interface-500);
|
||||
margin: 0;
|
||||
grid-column: 2;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.setting__section[data-setting=font] .setting__body {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
-moz-column-gap: 1ch;
|
||||
column-gap: 1ch;
|
||||
margin-bottom: var(--space-xs);
|
||||
}
|
||||
.setting__section[data-setting=font] .setting__body select {
|
||||
grid-column: span 2;
|
||||
margin-bottom: var(--space-xs);
|
||||
}
|
||||
|
||||
.setting__section[data-setting=border] .field-border__option {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
grid-template-columns: 9ch minmax(0, 1fr);
|
||||
margin-bottom: var(--space-xs);
|
||||
}
|
||||
|
||||
.setting__section[data-setting=margin],
|
||||
.setting__section[data-setting=padding] {
|
||||
display: block;
|
||||
}
|
||||
.setting__section[data-setting=margin] .setting__header,
|
||||
.setting__section[data-setting=padding] .setting__header {
|
||||
margin-bottom: var(--space-s);
|
||||
}
|
||||
.setting__section[data-setting=margin] .setting__header .label-with-tooltip,
|
||||
.setting__section[data-setting=padding] .setting__header .label-with-tooltip {
|
||||
flex-grow: 1;
|
||||
}
|
||||
.setting__section[data-setting=margin] .setting__header .lock-toggle svg,
|
||||
.setting__section[data-setting=padding] .setting__header .lock-toggle svg {
|
||||
color: var(--color-interface-400);
|
||||
}
|
||||
.setting__section[data-setting=margin] .setting__header .lock-toggle.locked svg,
|
||||
.setting__section[data-setting=padding] .setting__header .lock-toggle.locked svg {
|
||||
color: var(--color-interface-800);
|
||||
}
|
||||
.setting__section[data-setting=margin] .setting__body,
|
||||
.setting__section[data-setting=padding] .setting__body {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
grid-row-gap: var(--space-xs);
|
||||
grid-column-gap: var(--space-m);
|
||||
}
|
||||
.setting__section[data-setting=margin] .field-margin,
|
||||
.setting__section[data-setting=padding] .field-margin {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.setting__section[data-setting=margin] .field-margin .label-with-tooltip,
|
||||
.setting__section[data-setting=padding] .field-margin .label-with-tooltip {
|
||||
flex-grow: 1;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
button[disabled] {
|
||||
cursor: not-allowed !important;
|
||||
opacity: 0.6;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue