diff --git a/packages/common/styles.js b/packages/common/styles.js index fc6f992a8b9d13d8748b64a118e9a1da7b22b556..16475917af1adcaffa6126e315e0821960b6e37a 100644 --- a/packages/common/styles.js +++ b/packages/common/styles.js @@ -229,3 +229,178 @@ export function getButtonCSS() { } `; } + +export function getTagCSS() { + // language=css + return css` + .tags { + align-items: center; + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + } + + .tags .tag { + margin-bottom: 0.5rem; + } + + .tags .tag:not(:last-child) { + margin-right: 0.5rem; + } + + .tags:last-child { + margin-bottom: -0.5rem; + } + + .tags:not(:last-child) { + margin-bottom: 1rem; + } + + .tags.are-medium .tag:not(.is-normal):not(.is-large) { + font-size: 1rem; + } + + .tags.are-large .tag:not(.is-normal):not(.is-medium) { + font-size: 1.25rem; + } + + .tags.is-centered { + justify-content: center; + } + + .tags.is-centered .tag { + margin-right: 0.25rem; + margin-left: 0.25rem; + } + + .tags.is-right { + justify-content: flex-end; + } + + .tags.is-right .tag:not(:first-child) { + margin-left: 0.5rem; + } + + .tags.is-right .tag:not(:last-child) { + margin-right: 0; + } + + .tags.has-addons .tag { + margin-right: 0; + } + + .tags.has-addons .tag:not(:first-child) { + margin-left: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 0; + } + + .tags.has-addons .tag:not(:last-child) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; + } + + .tag:not(body) { + align-items: center; + background-color: whitesmoke; + border-radius: var(--vpu-border-radius); + color: #4a4a4a; + display: inline-flex; + font-size: 0.75rem; + height: 2em; + justify-content: center; + line-height: 1.5; + padding-left: 0.75em; + padding-right: 0.75em; + white-space: nowrap; + } + + .tag:not(body) .delete { + margin-left: 0.25rem; + margin-right: -0.375rem; + } + + .tag:not(body).is-dark { + background-color: var(--vpu-dark); + color: whitesmoke; + } + + .tag:not(body).is-light { + background-color: var(--vpu-light); + color: #363636; + } + + .tag:not(body).is-normal { + font-size: 0.75rem; + } + + .tag:not(body).is-medium { + font-size: 1rem; + } + + .tag:not(body).is-large { + font-size: 1.25rem; + } + + .tag:not(body) .icon:first-child:not(:last-child) { + margin-left: -0.375em; + margin-right: 0.1875em; + } + + .tag:not(body) .icon:last-child:not(:first-child) { + margin-left: 0.1875em; + margin-right: -0.375em; + } + + .tag:not(body) .icon:first-child:last-child { + margin-left: -0.375em; + margin-right: -0.375em; + } + + .tag:not(body).is-delete { + margin-left: 1px; + padding: 0; + position: relative; + width: 2em; + } + + .tag:not(body).is-delete::before, .tag:not(body).is-delete::after { + background-color: currentColor; + content: ""; + display: block; + left: 50%; + position: absolute; + top: 50%; + -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg); + transform: translateX(-50%) translateY(-50%) rotate(45deg); + -webkit-transform-origin: center center; + transform-origin: center center; + } + + .tag:not(body).is-delete::before { + height: 1px; + width: 50%; + } + + .tag:not(body).is-delete::after { + height: 50%; + width: 1px; + } + + .tag:not(body).is-delete:hover, .tag:not(body).is-delete:focus { + background-color: #e8e8e8; + } + + .tag:not(body).is-delete:active { + background-color: #dbdbdb; + } + + .tag:not(body).is-rounded { + border-radius: 290486px; + } + + a.tag:hover { + text-decoration: underline; + } + `; +}