pico/scss/content/_table.scss

51 lines
1.1 KiB
SCSS
Raw Normal View History

2019-11-27 15:31:49 +07:00
/**
* Table
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
2022-03-06 10:53:20 +07:00
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
2022-03-06 10:53:20 +07:00
// 1. Collapse border spacing in all browsers (opinionated)
// 2. Remove text indentation from table contents in Chrome, Edge, and Safari
:where(table) {
2019-11-27 15:31:49 +07:00
width: 100%;
border-collapse: collapse; // 1
2019-11-27 15:31:49 +07:00
border-spacing: 0;
2022-03-06 10:53:20 +07:00
text-indent: 0; // 2
2019-11-27 15:31:49 +07:00
}
// Pico
//
2019-11-27 15:31:49 +07:00
// Cells
th,
td {
2021-07-02 16:54:41 +07:00
padding: calc(var(--spacing) / 2) var(--spacing);
border-bottom: var(--border-width) solid var(--table-border-color);
color: var(--color);
2021-11-08 00:12:34 +07:00
font-weight: var(--font-weight);
font-size: var(--font-size);
2019-11-27 15:31:49 +07:00
text-align: left;
2021-10-24 02:06:00 +07:00
text-align: start;
2019-11-27 15:31:49 +07:00
}
2021-12-31 17:01:01 +07:00
// Footer
tfoot {
th,
td {
border-top: var(--border-width) solid var(--table-border-color);
border-bottom: 0;
}
}
2021-07-02 16:54:41 +07:00
// Striped
table {
&[role="grid"] {
tbody tr:nth-child(odd) {
background-color: var(--table-row-stripped-background-color);
2021-07-02 16:54:41 +07:00
}
2020-09-29 08:38:35 +07:00
}
2019-11-27 15:31:49 +07:00
}