UNPKG

atui

Version:

components built with Vue.js

89 lines (78 loc) 1.76 kB
// Badge // -------------------------------------------------- @prefix-cls-badge: e("@{prefix-cls}-badge"); @badge-link-hover-color: #fff; @badge-active-bg: #fff; // self @badge-count-bg: #ff6666; @badge-dot-bg: @badge-count-bg; @badge-count-text: #fff; // Base class .@{prefix-cls-badge} { position: relative; display: inline-block; min-width: 10px; padding: 3px 7px; line-height: 1; vertical-align: middle; white-space: nowrap; text-align: center; box-sizing: border-box; .@{prefix-cls-badge}-count { position: absolute; top: -5px; right: -4px; transform: translateX(30%); z-index: 10; min-width: 20px; height: 18px; line-height: 18px; background-color: @badge-count-bg; color: @badge-count-text; font-family: ArialMT; font-weight: 100; text-align: center; border-radius: 10px; padding: 0 7px; font-size: 11px; white-space: nowrap; transform: -10% center; box-shadow: 0 0 0 1px #fff; } .@{prefix-cls-badge}-dot { position: absolute; top: -1px; right: -2px; width: 8px; height: 8px; border-radius: 100%; background-color: @badge-dot-bg; z-index: 10; transform-origin: 0px center; transform: translateX(-50%); box-shadow: 0 0 0 1px #fff; } // Empty badges collapse automatically (not available in IE8) &:empty { display: none; } // Quick fix for badges in buttons .btn & { position: relative; top: -1px; } .btn-xs &, .btn-group-xs > .btn & { top: 0; padding: 1px 5px; } // Hover state, but only for links a { &:hover, &:focus { color: @badge-link-hover-color; text-decoration: none; cursor: pointer; } } }