UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

146 lines (145 loc) 8.45 kB
/* * Table theme * */ /* * Utilities */ /* * Table theme * */ /* * Button mixins * */ .dnb-table { --table-th-background-color: var(--sb-color-white); text-align: left; } .dnb-table__th, .dnb-table thead th { padding: 0.5rem 1.5rem 0.25rem; font-weight: var(--font-weight-medium); } .dnb-table .dnb-table__tr--even { background-color: var(--sb-color-gray-light-3); } .dnb-table__td, .dnb-table tbody .dnb-table__th, .dnb-table tbody td, .dnb-table tbody th { padding: 1rem 1.5rem; } .dnb-table thead + tbody .dnb-table__tr:first-child .dnb-table__td::after, .dnb-table thead + tbody .dnb-table__tr:first-child .dnb-table__th::after { content: ""; position: absolute; top: 0; left: 0; right: -0.0625rem; bottom: 0; z-index: 1; pointer-events: none; border-top: var(--table-border); } .dnb-table thead + tbody .dnb-table__tr:first-child .dnb-table__td:last-child::after, .dnb-table thead + tbody .dnb-table__tr:first-child .dnb-table__th:last-child::after { right: 0; } .dnb-table { /* BUTTONS INSIDE TABLE */ } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button .dnb-button__text::after, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button .dnb-button__text::after { bottom: -0.0625rem; left: 0; opacity: 0; color: var(--sb-color-violet); } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:not(:focus) .dnb-button__text::after, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:not(:focus) .dnb-button__text::after { color: var(--sb-color-violet); } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active[disabled], html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active[disabled], .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active[disabled], html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active[disabled] { cursor: not-allowed; } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before { content: ""; position: absolute; z-index: 1; top: 0; left: -0.5rem; bottom: 0; right: -0.5rem; height: inherit; border-radius: inherit; outline: none; } html[data-whatinput=mouse] .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html[data-whatinput=mouse] html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html[data-whatinput=mouse] .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html[data-whatinput=mouse] html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before { --border-color: var(--focus-ring-color); --border-width: var(--focus-ring-width); box-shadow: inset 0 0 0 var(--border-width) var(--border-color); border-color: transparent; } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before { content: ""; position: absolute; z-index: 1; top: 0; left: -0.5rem; bottom: 0; right: -0.5rem; height: inherit; border-radius: inherit; outline: none; } html[data-whatinput=touch] .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html[data-whatinput=touch] html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html[data-whatinput=touch] .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html[data-whatinput=touch] html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before { --border-color: var(--focus-ring-color); --border-width: var(--focus-ring-width); box-shadow: inset 0 0 0 var(--border-width) var(--border-color); border-color: transparent; } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before, html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:active:not([disabled])::before { top: -0.375rem; bottom: -0.25rem; left: -0.6875rem; right: -0.4375rem; } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus[disabled], .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus[disabled] { cursor: not-allowed; } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus:not([disabled])::before, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus:not([disabled])::before { top: -0.375rem; bottom: -0.25rem; left: -0.6875rem; right: -0.4375rem; } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus:not([disabled]):focus-visible, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus:not([disabled]):focus-visible { color: var(--sb-color-blue-dark); } .dnb-table > thead > tr > th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus:not([disabled]):not(:active) .dnb-button__text::after, .dnb-table .dnb-table__th.dnb-table--sortable .dnb-table__sort-button.dnb-button:focus:not([disabled]):not(:active) .dnb-button__text::after { visibility: hidden; } html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--active .dnb-table__sort-button.dnb-button:hover[disabled], html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--active .dnb-table__sort-button.dnb-button:hover[disabled] { cursor: not-allowed; } html:not([data-whatintent=touch]) .dnb-table > thead > tr > th.dnb-table--active .dnb-table__sort-button.dnb-button:hover:not([disabled]) .dnb-button__text::after, html:not([data-whatintent=touch]) .dnb-table .dnb-table__th.dnb-table--active .dnb-table__sort-button.dnb-button:hover:not([disabled]) .dnb-button__text::after { color: var(--sb-color-violet); } .dnb-table, .dnb-table__container { --table-border-color: var(--sb-color-gray-light-2); --table-outline-color: var(--sb-color-gray-light-2); --table-accordion-border-color: var(--sb-color-gray-light-2); --table-accordion-header-background: var(--sb-color-gray-light-2); --table-accordion-icon-color: var(--sb-color-text); --table-accordion-icon-color--active: var(--sb-color-violet); --table-accordion-icon-color--disabled: var(--sb-color-gray-dark-2); --table-accordion-outline-color: var(--sb-color-violet); --table-accordion-outline-width: var(--table-accordion-border-width); --table-accordion-outline-background--active: var( --sb-color-gray-light-2 ); background-color: var(--sb-color-white); } html[data-visual-test] .dnb-table, html[data-visual-test] .dnb-table__container { --table-border-color: blue; --table-outline-color: red; --table-accordion-border-color: green; }