primevue-mirror/components/lib/themes/primeone/base/button/index.js

653 lines
18 KiB
JavaScript
Raw Normal View History

export default {
css: ({ dt }) => `
.p-button {
display: inline-flex;
cursor: pointer;
user-select: none;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
2024-03-13 08:36:59 +00:00
color: ${dt('button.primary.color')};
background: ${dt('button.primary.background')};
border: 1px solid ${dt('button.primary.border.color')};
padding: 0.5rem 1rem;
font-size: 1rem;
font-family: inherit;
font-feature-settings: inherit;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
border-radius: ${dt('rounded.base')};
outline-color: transparent;
}
.p-button:disabled {
cursor: default;
}
.p-button-icon-left {
margin-right: 0.5rem;
}
.p-button-icon-right {
order: 1;
margin-left: 0.5rem;
}
.p-button-icon-top {
margin-bottom: 0.5rem;
}
.p-button-icon-bottom {
order: 2;
margin-top: 0.5rem;
}
.p-button-icon-only {
justify-content: center;
width: 2.5rem;
padding: 0.5rem 0;
}
.p-button-icon-only .p-button-label {
visibility: hidden;
width: 0;
}
.p-button.p-button-icon-only .p-button-icon-left,
.p-button.p-button-icon-only .p-button-icon-right {
margin: 0;
}
.p-button-icon-only.p-button-rounded {
border-radius: 50%;
height: 2.5rem;
}
.p-button-sm {
font-size: 0.875rem;
padding: 0.375rem 0.875rem;
}
.p-button-sm .p-button-icon {
font-size: 0.875rem;
}
.p-button-lg {
font-size: 1.25rem;
padding: 0.625rem 1.25rem;
}
2024-03-27 15:22:03 +00:00
.p-button-lg .p-button-icon {
font-size: 1.25rem;
}
.p-button-loading-label-only .p-button-label {
margin-left: 0.5rem;
}
.p-button-loading-label-only .p-button-loading-icon {
margin-right: 0;
}
.p-button-vertical {
flex-direction: column;
}
.p-button-label {
font-weight: 500;
}
.p-fluid .p-button {
width: 100%;
}
.p-fluid .p-button-icon-only {
width: 2.5rem;
}
.p-button:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.primary.hover.background')};
border: 1px solid ${dt('button.primary.hover.border.color')};
color: ${dt('button.primary.hover.color')};
}
.p-button:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.primary.active.background')};
border: 1px solid ${dt('button.primary.active.border.color')};
color: ${dt('button.primary.active.color')};
}
.p-button:focus-visible {
2024-03-13 08:36:59 +00:00
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('button.primary.background')};
outline-offset: ${dt('focus.ring.offset')};
}
.p-button .p-badge {
margin-left: 0.5rem;
min-width: 1rem;
height: 1rem;
line-height: 1rem;
2024-03-13 08:36:59 +00:00
background: ${dt('button.primary.color')};
color: ${dt('button.primary.background')};
}
.p-button-raised {
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
.p-button-rounded {
border-radius: 2rem;
}
/* Default Severities */
.p-button-secondary {
2024-03-13 08:36:59 +00:00
background: ${dt('button.secondary.background')};
border: 1px solid ${dt('button.secondary.border.color')};
color: ${dt('button.secondary.color')};
}
.p-button-secondary:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.secondary.hover.background')};
border: 1px solid ${dt('button.secondary.hover.border.color')};
color: ${dt('button.secondary.hover.color')};
}
.p-button-secondary:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.secondary.active.background')};
border: 1px solid ${dt('button.secondary.active.border.color')};
color: ${dt('button.secondary.active.color')};
}
.p-button-success {
2024-03-13 08:36:59 +00:00
background: ${dt('button.success.background')};
border: 1px solid ${dt('button.success.border.color')};
color: ${dt('button.success.color')};
}
.p-button-success:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.success.hover.background')};
border: 1px solid ${dt('button.success.hover.border.color')};
color: ${dt('button.success.hover.color')};
}
.p-button-success:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.success.active.background')};
border: 1px solid ${dt('button.success.active.border.color')};
color: ${dt('button.success.active.color')};
}
.p-button-success:focus-visible {
2024-03-13 08:36:59 +00:00
outline-color: ${dt('button.success.background')};
}
.p-button-info {
2024-03-13 08:36:59 +00:00
background: ${dt('button.info.background')};
border: 1px solid ${dt('button.info.border.color')};
color: ${dt('button.info.color')};
}
.p-button-info:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.info.hover.background')};
border: 1px solid ${dt('button.info.hover.border.color')};
color: ${dt('button.info.hover.color')};
}
.p-button-info:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.info.active.background')};
border: 1px solid ${dt('button.info.active.border.color')};
color: ${dt('button.info.active.color')};
}
.p-button-info:focus-visible {
2024-03-13 08:36:59 +00:00
outline-color: ${dt('button.info.background')};
}
.p-button-warning {
2024-03-13 08:36:59 +00:00
background: ${dt('button.warn.background')};
border: 1px solid ${dt('button.warn.border.color')};
color: ${dt('button.warn.color')};
}
.p-button-warning:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.warn.hover.background')};
border: 1px solid ${dt('button.warn.hover.border.color')};
color: ${dt('button.warn.hover.color')};
}
.p-button-warning:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.warn.active.background')};
border: 1px solid ${dt('button.warn.active.border.color')};
color: ${dt('button.warn.active.color')};
}
.p-button-warning:focus-visible {
2024-03-13 08:36:59 +00:00
background: ${dt('button.warn.background')};
}
.p-button-help {
2024-03-13 08:36:59 +00:00
background: ${dt('button.help.background')};
border: 1px solid ${dt('button.help.border.color')};
color: ${dt('button.help.color')};
}
.p-button-help:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.help.hover.background')};
border: 1px solid ${dt('button.help.hover.border.color')};
color: ${dt('button.help.hover.color')};
}
.p-button-help:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.help.active.background')};
border: 1px solid ${dt('button.help.active.border.color')};
color: ${dt('button.help.active.color')};
}
.p-button-help:focus-visible {
2024-03-13 08:36:59 +00:00
outline-color: ${dt('button.help.background')};
}
.p-button-danger {
2024-03-13 08:36:59 +00:00
background: ${dt('button.danger.background')};
border: 1px solid ${dt('button.danger.border.color')};
color: ${dt('button.danger.color')};
}
.p-button-danger:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.danger.hover.background')};
border: 1px solid ${dt('button.danger.hover.border.color')};
color: ${dt('button.danger.hover.color')};
}
.p-button-danger:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.danger.active.background')};
border: 1px solid ${dt('button.danger.active.border.color')};
color: ${dt('button.danger.active.color')};
}
.p-button-danger:focus-visible {
2024-03-13 08:36:59 +00:00
background: ${dt('button.danger.background')};
}
.p-button-contrast {
2024-03-13 08:36:59 +00:00
background: ${dt('button.contrast.background')};
border: 1px solid ${dt('button.contrast.border.color')};
color: ${dt('button.contrast.color')};
}
.p-button-contrast:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.contrast.hover.background')};
border: 1px solid ${dt('button.contrast.hover.border.color')};
color: ${dt('button.contrast.hover.color')};
}
.p-button-contrast:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.contrast.active.background')};
border: 1px solid ${dt('button.contrast.active.border.color')};
color: ${dt('button.contrast.active.color')};
}
.p-button-contrast:focus-visible {
2024-03-13 08:36:59 +00:00
outline-color: ${dt('button.contrast.background')};
}
/* Outlined Buttons */
.p-button-outlined {
background: transparent;
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.primary.border.color')};
color: ${dt('button.outlined.primary.color')};
}
.p-button-outlined:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.primary.hover.background')};
border-color: ${dt('button.outlined.primary.border.color')};
color: ${dt('button.outlined.primary.color')};
}
.p-button-outlined:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.primary.active.background')};
border-color: ${dt('button.outlined.primary.border.color')};
color: ${dt('button.outlined.primary.color')};
}
.p-button-outlined.p-button-secondary {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.secondary.border.color')};
color: ${dt('button.outlined.secondary.color')};
}
.p-button-outlined.p-button-secondary:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.secondary.hover.background')};
border-color: ${dt('button.outlined.secondary.border.color')};
color: ${dt('button.outlined.secondary.color')};
}
.p-button-outlined.p-button-secondary:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.secondary.active.background')};
border-color: ${dt('button.outlined.secondary.border.color')};
color: ${dt('button.outlined.secondary.color')};
}
.p-button-outlined.p-button-success {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.success.border.color')};
color: ${dt('button.outlined.success.color')};
}
.p-button-outlined.p-button-success:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.success.hover.background')};
border-color: ${dt('button.outlined.success.border.color')};
color: ${dt('button.outlined.success.color')};
}
.p-button-outlined.p-button-success:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.success.active.background')};
border-color: ${dt('button.outlined.success.border.color')};
color: ${dt('button.outlined.success.color')};
}
.p-button-outlined.p-button-info {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.info.border.color')};
color: ${dt('button.outlined.info.color')};
}
.p-button-outlined.p-button-info:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.info.hover.background')};
border-color: ${dt('button.outlined.info.border.color')};
color: ${dt('button.outlined.info.color')};
}
.p-button-outlined.p-button-info:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.info.active.background')};
border-color: ${dt('button.outlined.info.border.color')};
color: ${dt('button.outlined.info.color')};
}
.p-button-outlined.p-button-warning {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.warn.border.color')};
color: ${dt('button.outlined.warn.color')};
}
.p-button-outlined.p-button-warning:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.warn.hover.background')};
border-color: ${dt('button.outlined.warn.border.color')};
color: ${dt('button.outlined.warn.color')};
}
.p-button-outlined.p-button-warning:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.warn.active.background')};
border-color: ${dt('button.outlined.warn.border.color')};
color: ${dt('button.outlined.warn.color')};
}
.p-button-outlined.p-button-help {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.help.border.color')};
color: ${dt('button.outlined.help.color')};
}
.p-button-outlined.p-button-help:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.help.hover.background')};
border-color: ${dt('button.outlined.help.border.color')};
color: ${dt('button.outlined.help.color')};
}
.p-button-outlined.p-button-help:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.help.active.background')};
border-color: ${dt('button.outlined.help.border.color')};
color: ${dt('button.outlined.help.color')};
}
.p-button-outlined.p-button-danger {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.danger.border.color')};
color: ${dt('button.outlined.danger.color')};
}
.p-button-outlined.p-button-danger:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.danger.hover.background')};
border-color: ${dt('button.outlined.danger.border.color')};
color: ${dt('button.outlined.danger.color')};
}
.p-button-outlined.p-button-danger:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.danger.active.background')};
border-color: ${dt('button.outlined.danger.border.color')};
color: ${dt('button.outlined.danger.color')};
}
.p-button-outlined.p-button-contrast {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.contrast.border.color')};
color: ${dt('button.outlined.contrast.color')};
}
.p-button-outlined.p-button-contrast:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.contrast.hover.background')};
border-color: ${dt('button.outlined.contrast.border.color')};
color: ${dt('button.outlined.contrast.color')};
}
.p-button-outlined.p-button-contrast:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.contrast.active.background')};
border-color: ${dt('button.outlined.contrast.border.color')};
color: ${dt('button.outlined.contrast.color')};
}
.p-button-outlined.p-button-plain {
2024-03-13 08:36:59 +00:00
border-color: ${dt('button.outlined.plain.border.color')};
color: ${dt('button.outlined.plain.color')};
}
.p-button-outlined.p-button-plain:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.plain.hover.background')};
border-color: ${dt('button.outlined.plain.border.color')};
color: ${dt('button.outlined.plain.color')};
}
.p-button-outlined.p-button-plain:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.outlined.plain.active.background')};
border-color: ${dt('button.outlined.plain.border.color')};
color: ${dt('button.outlined.plain.color')};
}
/* Text Button */
.p-button-text {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.primary.color')};
}
.p-button-text:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.primary.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.primary.color')};
}
.p-button-text:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.primary.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.primary.color')};
}
.p-button-text.p-button-secondary {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.secondary.color')};
}
.p-button-text.p-button-secondary:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.secondary.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.secondary.color')};
}
.p-button-text.p-button-secondary:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.secondary.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.secondary.color')};
}
.p-button-text.p-button-success {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.success.color')};
}
.p-button-text.p-button-success:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.success.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.success.color')};
}
.p-button-text.p-button-success:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.success.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.success.color')};
}
.p-button-text.p-button-info {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.info.color')};
}
.p-button-text.p-button-info:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.info.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.info.color')};
}
.p-button-text.p-button-info:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.info.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.info.color')};
}
.p-button-text.p-button-warning {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.warn.color')};
}
.p-button-text.p-button-warning:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.warn.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.warn.color')};
}
.p-button-text.p-button-warning:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.warn.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.warn.color')};
}
.p-button-text.p-button-help {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.help.color')};
}
.p-button-text.p-button-help:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.help.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.help.color')};
}
.p-button-text.p-button-help:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.help.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.help.color')};
}
.p-button-text.p-button-danger {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.danger.color')};
}
.p-button-text.p-button-danger:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.danger.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.danger.color')};
}
.p-button-text.p-button-danger:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.danger.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.danger.color')};
}
.p-button-text.p-button-plain {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.plain.color')};
}
.p-button-text.p-button-plain:not(:disabled):hover {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.plain.hover.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.plain.color')};
}
.p-button-text.p-button-plain:not(:disabled):active {
2024-03-13 08:36:59 +00:00
background: ${dt('button.text.plain.active.background')};
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.text.plain.color')};
}
/* Link Button */
.p-button-link {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.link.color')};
}
.p-button-link:not(:disabled):hover {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.link.hover.color')};
}
.p-button-link:not(:disabled):hover .p-button-label {
text-decoration: underline;
}
.p-button-link:not(:disabled):active {
background: transparent;
border-color: transparent;
2024-03-13 08:36:59 +00:00
color: ${dt('button.link.active.color')};
}
.p-buttonset .p-button {
margin: 0;
}
.p-buttonset .p-button:not(:last-child),
.p-buttonset .p-button:not(:last-child):hover {
border-right: 0 none;
}
.p-buttonset .p-button:not(:first-of-type):not(:last-of-type) {
border-radius: 0;
}
.p-buttonset .p-button:first-of-type:not(:only-of-type) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.p-buttonset .p-button:last-of-type:not(:only-of-type) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.p-buttonset .p-button:focus-visible {
position: relative;
z-index: 1;
}
.p-fluid .p-buttonset {
display: flex;
}
.p-fluid .p-buttonset .p-button {
flex: 1;
}
`
};