UNPKG

zz-shopify-components

Version:

Reusable Shopify components for theme projects

465 lines (391 loc) 8.04 kB
html.zz-global-noscroll, html.zz-global-noscroll body { overflow: hidden !important; position: relative; height: 100% !important; } /* tab radio组件 */ .zz-radio-tabs { display: flex; align-items: center; height: 36px; border-radius: 32px; background: #F5F5F6; } body { overflow-x: hidden; } .zz-radio-tabs-black.zz-radio-tabs { background: #FFFFFF14; } .zz-radio-tabs-wrapper { position: relative; height: 100%; display: block; } .zz-radio-tabs-wrapper input[type="radio"] { display: none; } zz-radio-tabs-item { height: 100%; flex: 1; } .zz-radio-tabs-label { display: flex; align-items: center; justify-content: center; padding-right: 24px; padding-left: 24px; color: #000000; cursor: pointer; transition: background-color 0.2s; border-radius: 40px; font-family: Poppins; font-weight: 500; font-size: 12px; line-height: 100%; letter-spacing: 0px; text-align: center; vertical-align: middle; height: 100%; white-space: nowrap; } .zz-radio-tabs-black.zz-radio-tabs .zz-radio-tabs-label { color: #FFFFFF; } .zz-radio-tabs-wrapper input[type="radio"]:checked+.zz-radio-tabs-label { background: #000000; color: #FFFFFF; } .zz-radio-tabs-black.zz-radio-tabs .zz-radio-tabs-wrapper input[type="radio"]:checked+.zz-radio-tabs-label { background: #FFFFFF1F; color: #FFFFFF; } @media (min-width: 1024px) { .zz-radio-tabs { height: 48px; } .zz-radio-tabs-label { font-size: 16px; } } /* select组件 */ .zz-select-bordered { border-color: var(--fallback-bc, oklch(var(--bc) / .2)); } .zz-select { display: inline-flex; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-appearance: none; -moz-appearance: none; appearance: none; color: #000000; padding-inline-start: 14px; padding-inline-end: 28px; font-size: 12px; height: 30px; line-height: 1.5; border-radius: 4px; border-width: 1px; border-color: #00000026; background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 16px) calc(1px + 50%), calc(100% - 12px) calc(1px + 50%); background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; } .zz-select:focus { border-color: #FC6C0F; outline: none; box-shadow: none; } @media (min-width: 1024px) { .zz-select { height: 40px; font-size: 14px; } } /* 内容描述 */ .content-text strong { color: #000000; font-weight: inherit; } .content-text a { color: #378DDD; text-decoration: underline; } .content-text a:hover { opacity: 0.8; } .content-text ol { list-style: decimal; padding-left: 25px; } .content-text ul { list-style: disc; padding-left: 20px; } /* 标题 */ .zz-title-hx p { margin: 0; } .zz-tag::before { content: ''; position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; background: var(--zz-tag-bg-color); transform: skew(-20deg); border-radius: 4px; z-index: -1; } /* dialog 弹窗组件, PC中间弹出,移动端底部弹出 */ body.zz-dialog-open { overflow: hidden; touch-action: none; } .zz-dialog-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: none; z-index: 1000; } .zz-dialog { position: fixed; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); z-index: 1001; display: none; transition: all 0.3s ease; } @media (min-width: 1024px) { .zz-dialog { top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.7); opacity: 0; } .zz-dialog.show { transform: translate(-50%, -50%) scale(1); opacity: 1; } } @media (max-width: 1023px) { .zz-dialog { bottom: 0; left: 0; width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; transform: translateY(100%); } .zz-dialog.show { transform: translateY(0); } } .zz-underline { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; /* 调整位置 */ } /* 按钮样式 zz-btn */ .zz-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0px 24px; border-radius: 4px; transition: opacity 0.2s cubic-bezier(.4, 0, .2, 1); outline: none; gap: 7px; font-weight: 500; border: none; cursor: pointer; } /* 类型和颜色组合 */ .zz-btn.zz-btn-primary.zz-btn-black { background: #000000; color: #fff; } .zz-btn.zz-btn-primary.zz-btn-white { background: #fff; color: #000000; border: 1.5px solid #fff; } .zz-btn.zz-btn-primary.zz-btn-orange { background: #FC6C0F; color: #fff; } .zz-btn.zz-btn-primary.zz-btn-blue { background: #378DDD; color: #fff; } .zz-btn.zz-btn-primary.zz-btn-yellow { background: linear-gradient(139.02deg, #FFEB00 0.01%, #FFD400 100.55%); color: #000000; } .zz-btn.zz-btn-primary-round.zz-btn-black { background: #000000; color: #fff; border-radius: 30px; } .zz-btn.zz-btn-primary-round.zz-btn-white { background: #fff; color: #000000; border-radius: 30px; } .zz-btn.zz-btn-default.zz-btn-black { background: transparent; color: #000000; border: 1.5px solid #000000; } .zz-btn.zz-btn-default.zz-btn-white { background: transparent; color: #fff; border: 1.5px solid #fff; } .zz-btn.zz-btn-default.zz-btn-orange { background: transparent; color: #FC6C0F; border: 1.5px solid #FC6C0F; } .zz-btn.zz-btn-default.zz-btn-yellow { background: transparent; color: #000; border: 1.5px solid #FFEB00; } .zz-btn.zz-btn-default.zz-btn-blue { background: transparent; color: #378DDD; border: 1.5px solid #378DDD; } .zz-btn.zz-btn-round.zz-btn-black { background: transparent; color: #000000; border: 1.5px solid #000000; border-radius: 30px; } .zz-btn.zz-btn-round.zz-btn-white { background: transparent; color: #fff; border: 1.5px solid #fff; border-radius: 30px; } .zz-btn.zz-btn-round.zz-btn-orange { background: transparent; color: #ff9900; border: 1.5px solid #ff9900; border-radius: 30px; } .zz-btn-link.zz-btn-blue { color: #378DDD; } .zz-btn-link.zz-btn-orange { color: #FC6C0F; } .zz-btn-link.zz-btn-white { color: #fff; } .zz-btn-link.zz-btn-black { color: #000000; } .zz-btn:hover { opacity: 0.8; } .zz-btn:active { transform: scale(0.97); } .zz-btn:disabled { opacity: 0.5; cursor: not-allowed; } .zz-btn.zz-btn-large { height: 42px; padding: 0px 28px; } .zz-btn.zz-btn-small { height: 21px; padding: 0px 10px; font-size: 10px; } .zz-btn-link.zz-btn-link-small { font-size: 10px; } .zz-btn-link.zz-btn-link-large { font-size: 14px; } @media (min-width: 1024px) { .zz-btn.zz-btn-large { height: 48px; padding: 0px 32px; } .zz-btn.zz-btn-small { height: 26px; padding: 0px 10px; font-size: 14px; } .zz-btn-link.zz-btn-link-small { font-size: 12px; } .zz-btn-link.zz-btn-link-large { font-size: 16px; } } .zz-btn-shape-round { border-radius: 90px; } .zz-video { border-radius: inherit; } .zz-toast-layer { position: fixed; inset: 0; display: grid; place-items: start center; padding-top: 20%; pointer-events: none; /* 不阻挡点击 */ z-index: 9999; /* 最高层 */ } .zz-toast-box { pointer-events: auto; max-width: min(86vw, 520px); box-sizing: border-box; padding: 12px 16px; border-radius: 12px; background: #fff; color: #161110; box-shadow: 0px 2px 16px 0px #00000026; font-size: 14px; text-align: left; word-break: break-word; transform: translateZ(0) scale(.96); opacity: 0; transition: transform .18s ease, opacity .18s ease; line-height: 1.2; display: inline-flex; } .zz-toast-icon { margin-right: 4px; padding: 0px 2px; } @media screen and (min-width: 1024px) { .zz-toast-msg { font-size: 16px; } } .zz-toast-box.show { opacity: 1; transform: translateZ(0) scale(1); }