UNPKG

@gravityforms/components

Version:

UI components for use in Gravity Forms development. Both React and vanilla js flavors.

248 lines (202 loc) 5.88 kB
.gform-admin { .gform-input--radio { border: 0 none; clip: rect(0, 0, 0, 0); -webkit-clip-path: inset(50%); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; + label::before { background-color: var(--gform-admin-color-white); border: 1px solid var(--gform-admin-color-amethyst-smoke); border-radius: 50%; content: ""; display: inline-block; height: 1.25rem; margin-right: 0.625rem; top: 1.5625rem; transition: var(--gform-admin-transition-inputs); vertical-align: middle; width: 1.25rem; } &:hover + label, &:focus + label { &::before { background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z' fill='%23ECEDF8'/%3E%3C/svg%3E"); /* stylelint-disable-line */ background-position: center; background-repeat: no-repeat; border-color: var(--gform-admin-color-primary-light); box-shadow: var(--gform-admin-box-shadow-focus); display: inline-block; } } &:checked { + label { &::before { background-color: var(--gform-admin-color-white); background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z' fill='%233E7DA6'/%3E%3C/svg%3E"); /* stylelint-disable-line */ background-position: center; background-repeat: no-repeat; border-color: var(--gform-admin-color-amethyst-smoke); } } } } /* Cosmos Theme */ .gform-input-wrapper--theme-cosmos.gform-input-wrapper--radio { &, *, *::before, *::after { box-sizing: border-box; } } .gform-input-wrapper--theme-cosmos .gform-input--radio { + .gform-label { align-items: flex-start; display: flex; &::before { border: 0.0625rem solid var(--gform-admin-color-santas); border-radius: 50%; box-shadow: var(--gform-admin-box-shadow-micro); flex: none; margin-right: var(--gform-admin-spacer-2); } } &:hover + .gform-label::before { background-color: var(--gform-admin-color-light-blue); background-image: none; } &:focus + .gform-label::before { background-color: var(--gform-admin-color-light-blue); background-image: none; border-color: var(--gform-admin-color-blue-ribbon); box-shadow: var(--gform-admin-box-shadow-focus-state); } &:checked + .gform-label::before { background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxjaXJjbGUgY3g9IjQiIGN5PSI0IiByPSI0IiBmaWxsPSIjMEYzRDZDIi8+PC9zdmc+"); /* stylelint-disable-line */ } &:disabled { + .gform-label { color: var(--gform-admin-color-snuff); &::before { background-color: var(--gform-admin-color-light-blue); border-color: var(--gform-admin-color-white-lilac); box-shadow: none; opacity: 1; } } &:checked + .gform-label::before { background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxjaXJjbGUgY3g9IjQiIGN5PSI0IiByPSI0IiBmaWxsPSIjRUFFQ0YwIi8+PC9zdmc+"); /* stylelint-disable-line */ } ~ .gform-input-help-text { color: var(--gform-admin-color-snuff); } } &.gform-input--size-sm { + .gform-label::before { height: 1rem; margin-right: var(--gform-admin-spacer-2); width: 1rem; } &:checked + .gform-label::before { background-size: 6px; } ~ .gform-input-help-text { margin-left: 1.625rem; } } &.gform-input--size-md { + .gform-label::before { height: 1.25rem; margin-right: var(--gform-admin-spacer-3); margin-top: -0.0625rem; width: 1.25rem; } ~ .gform-input-help-text { margin-left: 2.125rem; } } } /* todo: in progress with adam */ .gform-input-wrapper.gform-input-wrapper--type-image { align-items: center; display: flex; height: 145px; justify-content: center; position: relative; width: 150px; .gform-label { border: 1px solid var(--gform-admin-color-snuff); border-radius: 3px; box-shadow: var(--gform-admin-box-shadow-micro); color: transparent; display: block; height: 100%; left: 0; overflow: hidden; position: absolute; top: 0; transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out; width: 100%; &:hover { box-shadow: var(--gform-admin-box-shadow-popup); } &::before { display: none; } } .gform-input--radio { &:checked { &:focus { + label { &::before { box-shadow: none; } } } + label { border-color: var(--gform-admin-color-chathams); box-shadow: 0 0 1px rgba(18, 25, 97, 0.24), 0 24px 24px rgba(18, 25, 97, 0.03), 0 2px 2px rgba(18, 25, 97, 0.03), 0 4px 4px rgba(18, 25, 97, 0.03), 0 8px 8px rgba(18, 25, 97, 0.03), 0 16px 16px rgba(18, 25, 97, 0.03); &::before { background: var(--gform-admin-color-chathams); border: 0; border-radius: 0; display: block; height: 50px; margin: 0; position: absolute; right: -25px; top: -25px; transform: rotate(45deg); width: 50px; } &::after { color: var(--gform-admin-color-white); content: var(--gform-common-icon--check-mark); display: block; font-family: var(--gform-common-font-family-icons); font-size: 0.875rem; position: absolute; right: 2px; top: 1px; } } } } } } html[dir="rtl"] .gform-admin { .gform-input--radio { + label { &::before { margin-left: 0.625rem; margin-right: 0; } } } }