UNPKG

@freshworks/crayons

Version:
158 lines (151 loc) 3.58 kB
/* Need to check with designer */ /* Need to check with designer */ :host { font-family: var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; } .radio-container { display: inline-block; position: relative; padding-left: 22px; margin-right: 10px; max-width: 80ch; word-wrap: break-word; } /* Focus event occurs on the root element */ :host(:focus) input[type=radio] + label::before { border: 1px solid transparent; box-shadow: 0 0 0 2px #2c5cc5; border-color: #081824; } :host(:focus) input[type=radio][disabled] + label::before { box-shadow: none; border: 1px solid #dadfe3; } /* Hover event occurs on the root element */ :host(:hover) input[type=radio] + label::before { box-shadow: 0 0 0 5px #ebeff3; border-color: #081824; } :host(:hover) input[type=radio][disabled] + label { cursor: not-allowed; } :host(:hover) input[type=radio][disabled] + label::before { box-shadow: none; border: 1px solid #dadfe3; } #description { font-size: 12px; color: #475867; letter-spacing: 0; line-height: 20px; position: relative; font-weight: 400; } input[type=radio] { display: none; } input[type=radio] + label { user-select: none; cursor: pointer; margin-bottom: 4px; vertical-align: middle; font-size: 14px; line-height: 20px; color: #12344d; font-weight: 600; } input[type=radio] + label::before, input[type=radio] + label::after { content: ""; display: block; position: absolute; top: 0; box-sizing: border-box; } @media screen and (prefers-reduced-motion: reduce) { input[type=radio] + label::before { transition: none; } } input[type=radio] + label::before { left: 0; border: 1px solid #cfd7df; border-radius: 50px; top: 4px; width: 14px; height: 14px; background: #fff; transition: all 0.3s ease; } @media screen and (prefers-reduced-motion: reduce) { input[type=radio] + label.error::before { transition: none; } } input[type=radio] + label.error::before { left: 0; border: 1px solid #d72d30; border-radius: 50px; top: 4px; width: 14px; height: 14px; background: #fff; transition: all 0.3s ease; } @media screen and (prefers-reduced-motion: reduce) { input[type=radio] + label::after { transition: none; } } input[type=radio] + label::after { left: 3px; border-radius: 100%; width: 8px; height: 8px; opacity: 0; transition: opacity 0.2s ease-in-out; box-sizing: border-box; } input[type=radio]:checked + label::before { background: #fff; border-color: #2c5cc5; box-shadow: none; } input[type=radio]:checked + label::after { border-radius: 50%; background-color: #2c5cc5; opacity: 1; top: 7px; } input[type=radio]:checked:focus + label::before { border-color: #3868d3; box-shadow: 0 0 4px 1px rgba(44, 92, 197, 0.6); } input[type=radio]:checked:focus + label::after { background-color: #3868d3; } input[type=radio][disabled] + label { color: #92a2b1; } input[type=radio][disabled] + label .label-field { color: #92a2b1; } input[type=radio][disabled] + label::before { border-color: #dadfe3; background-color: #ebeff3; } input[type=radio][disabled] + label::after { border-color: #ebeff3; background-color: #dadfe3; } input[type=radio][disabled]:checked + label { color: #92a2b1; } :host(.fw-radio-group__radio) { margin-bottom: 8px; } :host(.fw-radio-group__radio--last) { margin-bottom: 0px; }