/* GENERAL STYLES FOR FORMS */ form { margin: 20px 0; } /* FORM GROUPS */ .form-group { position: relative; display: flex; display: grid; grid-template-columns: 1fr 3fr; grid-gap: 5px; justify-content: flex-start; align-items: baseline; border-left: 2px solid transparent; + .form-group { margin-top: 17px; } } .form-group__label { font-weight: 600; } @media (max-width: 768px) { .form-group { grid-template-columns: 1fr; align-items: baseline; margin-top: 17px; flex-direction: column; } } /* TEXT INPUTS */ input[type="text"], input[type="password"], input[type="url"], input[type="number"], input[type="email"], input[type*="date"], input[type*="time"] { /* from bulma.css */ color: #363636; border-color: #dbdbdb; background-color: #f3f3f3; box-shadow: inset 0 1px 2px 1px rgba(50,50,50,.05); width: 100%; max-width: 600px; -webkit-appearance: none; align-items: center; border: 1px solid transparent; border-radius: 4px; font-size: 1rem; line-height: 1.5; padding: 4px 13px; } input[type*="date"], input[type*="time"] { width: 50%; min-width: 240px; } .form-group--required { .form-group__label::before { content: '*'; position: absolute; left: -14px; } input, textarea { border-bottom-color: var(--color-primary); } } .form-group--valid { input, textarea { border-bottom-color: var(--color-success); } } .form-group--has-error { input, textarea { border-bottom-color: var(--color-error); } } input[type="text"]:focus, input[type="password"]:focus, input[type="url"]:focus, input[type="number"]:focus, input[type="email"]:focus { /* border-bottom-color: var(--color-light); background-color: transparent; box-shadow: 0 0 13px var(--color-lighter); */ border-color: #3273dc; box-shadow: 0 0 0 0.125em rgba(50,115,220,.25); outline: 0; } /* BUTTON STYLE SEE default-layout.lucius */ /* TEXTAREAS */ textarea { width: 100%; height: 170px; max-width: 600px; font-size: 1rem; line-height: 1.5; color: #363636; background-color: #f3f3f3; padding: 4px 13px; -webkit-appearance: none; appearance: none; border: 1px solid #dbdbdb; border-radius: 2px; box-shadow: inset 0 1px 2px 1px rgba(50,50,50,.05); } textarea:focus { border-color: #3273dc; box-shadow: 0 0 0 0.125em rgba(50,115,220,.25); outline: 0; } /* CUSTOM LEGACY CHECKBOX AND RADIO BOXES */ input[type="checkbox"] { position: relative; height: 20px; width: 20px; -webkit-appearance: none; appearance: none; cursor: pointer; } input[type="checkbox"]::before { content: ''; position: absolute; width: 20px; height: 20px; background-color: var(--color-lighter); display: flex; align-items: center; justify-content: center; border-radius: 2px; } input[type="checkbox"]:checked::before { background-color: var(--color-light); } input[type="checkbox"]:checked::after { content: '✓'; position: absolute; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: white; font-size: 20px; } /* CUSTOM CHECKBOXES AND RADIO BOXES */ /* Completely replaces legacy checkbox and radiobox */ .checkbox, .radio { position: relative; [type="checkbox"], [type="radio"] { display: none; } label { display: block; height: 30px; width: 30px; background-color: var(--color-grey); border-radius: 4px; color: white; cursor: pointer; } label::before, label::after { content: ''; position: absolute; top: 14px; left: 5px; display: block; width: 20px; height: 20px; background-color: white; transition: all .2s; } label::before { width: 20px; height: 2px; transform: scale(0.1, 0.1); } label::after { width: 20px; height: 2px; transform: scale(0.1, 0.1); } :checked + label { background-color: var(--color-light); text-decoration: underline; } :checked + label::before { transform: scale(1, 1) rotate(45deg); } :checked + label::after { transform: scale(1, 1) rotate(-45deg); } } .radio label::before { transform: scale(0.01, 0.01) rotate(45deg); } .radio label::after { transform: scale(0.01, 0.01) rotate(-45deg); } .radio::before { content: ''; position: absolute; top: 2px; left: 2px; right: 2px; bottom: 2px; border-radius: 4px; border: 2px solid white; z-index: -1; } /* CUSTOM FILE INPUT */ input[type="file"].js-file-input { color: white; width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; position: absolute; z-index: -1; outline: 0; border: 0; } .file-input__wrapper { grid-column-start: 2; } .file-input__container, .file-checkbox__container, .file-input__unpack { grid-column-start: 2; margin: 4px 0; } .file-input__label, .file-input__remover, .file-checkbox__label, .file-checkbox__remover { display: block; border-radius: 2px; padding: 5px 13px; color: var(--color-lightwhite); cursor: pointer; } .file-input__label, .file-checkbox__label { text-align: left; position: relative; height: 30px; } .file-checkbox__label { background-color: var(--color-grey); text-decoration: line-through; } .file-input__label.btn, .file-checkbox__label.btn { padding: 5px 13px; } .file-input__label::after, .file-input__label::before { position: absolute; content: ''; background-color: white; width: 16px; height: 2px; top: 14px; top: 50%; left: 12px; left: 50%; } .file-input__label::after { transform: translate(-50%, -50%) rotate(90deg); } .file-input__label::before { transform: translate(-50%, -50%); } .file-checkbox__checkbox { margin-left: 10px; } .file-input__remover { display: none; width: 40px; height: 30px; text-align: center; background-color: var(--color-warning); position: relative; margin-left: 10px; } .file-input__remover::before { position: absolute; content: ''; width: 16px; height: 2px; top: 14px; left: 12px; background-color: white; } .file-input__container--valid > .file-input__label { background-color: var(--color-light); } .file-checkbox__container--checked > .file-checkbox__label { text-decoration: none; background-color: var(--color-lighter); &.btn:hover { background-color: var(--color-lighter); text-decoration: line-through; } } .file-input__container--valid > .file-input__label::before, .file-input__container--valid > .file-input__label::after { content: none; } .file-input__container--valid > .file-input__remover { display: block; } @media (max-width: 768px) { .file-input__wrapper, .file-input__container, .file-checkbox__container, .file-input__unpack { grid-column-start: 1; } }