/** * Copyright (c) HashiCorp, Inc. * SPDX-License-Identifier: MPL-2.0 */ // This file defines the styles for .checkbox, .radio and .b-checkboxes. The prefix "b" comes from Bulma. @import '../sass-svg-uri/svg-uri'; // checkbox and radio styling .checkbox, .radio { cursor: pointer; display: inline-block; line-height: 1.25; position: relative; } .checkbox input, .radio input { cursor: pointer; } .checkbox:hover, .radio:hover { color: hsl(0, 0%, 21%); } .checkbox[disabled], .radio[disabled], .checkbox input[disabled], .radio input[disabled] { color: $grey; cursor: not-allowed; } // radio only styling .radio + .radio { margin-left: 0.5em; } // one-off checkbox class .checkbox-help-text { color: $ui-gray-700; font-size: $size-7; padding-left: 28px; } // b-checkbox styling .b-checkbox { position: relative; } .b-checkbox label::before { background-color: $white; border-radius: 3px; border: 1px solid $ui-gray-300; content: ''; height: 17px; left: 0; position: absolute; top: 1px; transition: background 0.1s ease-in-out; width: 17px; } .b-checkbox input[type='checkbox']:checked + label::before { border-color: $blue; } .b-checkbox input[type='checkbox']:checked + label::after, .b-checkbox input[type='radio']:checked + label::after { font-family: $family-monospace; /*checkmark from ionicons*/ content: svg-uri( '' ); } .b-checkbox input[type='checkbox'], .b-checkbox input[type='radio'] { cursor: pointer; opacity: 0; z-index: 1; } .b-checkbox label::after { color: $ui-gray-800; font-size: 12px; height: 16px; left: 3px; position: absolute; top: 3px; width: 16px; } .b-checkbox label { display: inline; line-height: 1; margin-left: 0.5rem; padding-left: 5px; } .b-checkbox input[type='checkbox']:focus + label::before, .b-checkbox input[type='radio']:focus + label::before { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .b-checkbox input[type='checkbox']:disabled + label::before, .b-checkbox input[type='radio']:disabled + label::before { background-color: $ui-gray-100; cursor: not-allowed; } .b-checkbox input[type='checkbox']:disabled + label, .b-checkbox input[type='radio']:disabled + label { opacity: 0.65; } .b-checkbox > .sub-text { padding-left: 2rem; }