UNPKG

@ppci/custom-card

Version:

Custom Card

114 lines (99 loc) 2.11 kB
import { css } from 'lit-element'; import { gray, gray10, gray15, gray45, space, iconFont, } from '@ppci/styles'; export default css` :host { display: block; max-width: 1000px; border-radius: 2px; background-color: var(--theme-card-background, white); } :host > a, :host > div { min-width: 230px; display: block; text-decoration: none; transition: 300ms; border-radius: 2px; box-shadow: 0 0 3px 0 ${gray15.var}; } :host .hover:hover { cursor: pointer; background: ${gray10.var}; } h3 { margin: 0; font-family: Raleway; font-weight: bold; font-size: 1rem; line-height: 1.25rem; color: ${gray.var}; white-space: nowrap; text-overflow: ellipsis; } p { margin: 0; color: ${gray45.var}; font-size: 0.875rem; font-weight: normal; line-height: 1.45rem; } .image-wrapper { position: relative; } .visual { width: 100%; position: relative; padding-bottom: 50%; background-color: gainsboro; background-position: center center; background-size: cover; border-radius: var(--theme-border-radius, 0) var(--theme-border-radius, 0) 0 0; } .imageWrapper { position: relative; } .visual.soldOut { opacity: 0.6; } span.soldOut { position: absolute; top: calc(${space} / 2); left: calc(${space} / 2); border-radius: 2px; box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.15); background-color: #ffffff; padding: 0 4px; font-family: Raleway; display: flex; justify-content: center; align-items: center; font-size: 0.75rem; font-weight: bold; font-stretch: normal; font-style: normal; line-height: normal; letter-spacing: normal; color: ${gray.var}; } span.soldOut:before { ${iconFont} content: var(--icon-soldOut, "\\e913");; font-size: 0.75rem; padding: 2px; } .info { display: flex; align-items: center; padding: ${space}; } .description { margin: 0; padding: 0 ${space}; } .description:empty { display: none; } `;