UNPKG

tagelect

Version:

Tag input field with autocomplete and validations.

68 lines (61 loc) 2.12 kB
* { --tagelect-text-color: #232323; --tagelect-bg-color: white; --tagelect-border-color: #d9d9d9; --tagelect-tag-bg-color: #d9d9d9; --tagelect-placeholder-color: #d9d9d9; --tagelect-remove-btn-color: #232323; --tagelect-remove-btn-hover-color: #ea0000; --tagelect-dropdown-bg-color: white; --tagelect-dropdown-text-color: #232323; --tagelect-dropdown-border-color: #d9d9d9; --tagelect-dropdown-hover-color: #232323; --tagelect-dropdown-hover-bg-color: #e3e3e3; --tagelect-suggestion-color: #d9d9d9; } .tagelect-content { padding: 0.25rem 0.5rem 0 0.5rem; color: var(--tagelect-text-color); background-color: var(--tagelect-bg-color); border: 1px solid var(--tagelect-border-color); border-radius: 0.25rem; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; } .tagelect-input { margin-bottom: 0.5rem; } .tagelect-input:focus { outline: none; } .tagelect-input:empty:before { content: attr(data-placeholder); color: var(--tagelect-placeholder-color); } .tagelect-input:not(:empty):after { content: attr(data-suggestion); color: var(--tagelect-suggestion-color); } .tagelect-tag { padding: 0.125rem 0.25rem; border-radius: 0.25rem; background-color: var(--tagelect-tag-bg-color); display: flex; margin: 0 0.25rem 0.25rem 0; word-break: break-word; } .tagelect-tag-remove-btn { margin-left: 0.25rem; } .tagelect-tag-remove-btn:hover { color: var(--tagelect-remove-btn-hover-color); } .tagelect-dropdown { background-color: var(--tagelect-dropdown-bg-color); color: var(--tagelect-dropdown-text-color); list-style: none; width: 100%; padding: 0; border: 1px solid var(--tagelect-dropdown-border-color); margin: -0.125rem 0 0 0; } .tagelect-dropdown-item { padding: 0.375rem; } .tagelect-dropdown-item--selected { color: var(--tagelect-dropdown-hover-color); background-color: var(--tagelect-dropdown-hover-bg-color); } .tagelect-dropdown-item:hover { color: var(--tagelect-dropdown-hover-color); background-color: var(--tagelect-dropdown-hover-bg-color); }