UNPKG

@create-figma-plugin/ui

Version:

Production-grade Preact components that replicate the Figma UI design

113 lines (100 loc) 2.54 kB
.textboxColor { position: relative; z-index: var(--z-index-1); display: flex; width: 156px; align-items: center; border-radius: var(--border-radius-4); background-color: var(--figma-color-bg-secondary); } .textboxColor:focus-within { z-index: var( --z-index-2 ); /* Stack `.textboxColor` over its sibling elements */ } .disabled, .disabled * { cursor: not-allowed; } .fullWidth { width: 100%; } .chit { display: flex; overflow: hidden; height: 14px; flex: 0 0 14px; border-radius: var(--border-radius-2); margin-left: calc(var(--space-6) - var(--border-width-1)); background-image: url('data:image/svg+xml;utf8,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M0%200H3V3H0V0Z%22%20fill%3D%22%23E1E1E1%22/%3E%3Cpath%20d%3D%22M3%200H6V3H3V0Z%22%20fill%3D%22white%22/%3E%3Cpath%20d%3D%22M3%203H6V6H3V3Z%22%20fill%3D%22%23E1E1E1%22/%3E%3Cpath%20d%3D%22M0%203H3V6H0V3Z%22%20fill%3D%22white%22/%3E%3C/svg%3E%0A'); } .disabled .chit { opacity: var(--opacity-30); } .color { flex: 1; background: none; } .hexColorSelector { position: absolute; top: 50%; left: 0; width: var(--space-24); height: var(--space-32); opacity: 0; transform: translate(0, -50%); } .input { display: block; width: 100%; height: var(--space-24); background-color: transparent; color: var(--figma-color-text); } .input::placeholder { color: var(--figma-color-text-tertiary); } .input::-webkit-inner-spin-button, .input::-webkit-outer-spin-button { -webkit-appearance: none; } .hexColorInput { flex: 1 67px; padding-left: var(--space-6); border-right: var(--border-width-1) solid var(--figma-color-bg); } .opacityInputWrapper { position: relative; flex: 0 0 54px; } .opacityInput { padding-left: var(--space-8); } .percentage { position: absolute; top: 50%; right: var(--space-6); color: var(--figma-color-text-secondary); pointer-events: none; text-align: right; transform: translate(0, -50%); } .disabled .percentage { color: var(--figma-color-text-disabled); } .border { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border: var(--border-width-1) solid transparent; border-radius: var(--border-radius-4); pointer-events: none; } .textboxColor:not(.disabled):hover .border { border-color: var(--figma-color-border); } .textboxColor:not(.disabled):focus-within .border { border-color: var(--figma-color-border-selected); }