0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
wagtail/client/scss/components/_listing.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

681 lines
11 KiB
SCSS
Raw Normal View History

2015-11-03 13:15:33 +01:00
// General listings, like for pages, images or snippets
ul.listing {
@include unlist();
}
.listing {
margin-bottom: 2em;
color: theme('colors.text-context');
font-size: 0.95em;
ul {
2015-11-19 07:05:57 +01:00
list-style-type: none;
margin: 0;
padding-inline-start: 0;
}
> li {
padding: 1em 0;
border-bottom: 1px dashed theme('colors.border-field-default');
}
h3 {
margin: 0;
font-size: 1em;
}
td,
th {
padding: 1.2em 1em;
2017-01-05 11:45:41 +01:00
&.no-padding {
padding: 0;
}
}
&.small td,
th {
padding: 0.6em 1em;
}
td {
vertical-align: top;
}
td.title {
padding: 1em;
line-height: 2em;
}
thead {
font-size: 1.1em;
color: theme('colors.text-context');
border-bottom: 1px solid theme('colors.border-furniture');
2015-11-03 13:15:33 +01:00
th {
font-size: 0.9em;
text-align: start;
font-weight: normal;
white-space: nowrap;
}
th.children {
border: 0;
}
2015-11-03 13:15:33 +01:00
th a {
text-decoration: none;
color: inherit;
position: relative;
2017-01-05 11:45:41 +01:00
&.icon:after {
inset-inline-end: 0;
2017-01-05 11:45:41 +01:00
}
}
}
&.full-width td:first-child,
2015-11-03 13:15:33 +01:00
&.full-width th:first-child {
padding-inline-start: 20px;
padding-inline-end: 20px;
input[type='checkbox'] {
margin-inline-end: 0;
}
}
&.full-width {
margin-bottom: -3em; // this negates the padding added to the bottom of .content
}
.table-headers {
border-bottom: 1px solid theme('colors.border-furniture');
}
tbody {
border-bottom: 1px dashed theme('colors.border-field-default');
tr {
border-top: 1px dashed theme('colors.border-field-default');
&:first-child {
border-top: 1px dashed theme('colors.border-field-default');
}
&:hover {
background-color: theme('colors.white-10');
}
}
2015-11-03 13:15:33 +01:00
tr.selected {
background-color: theme('colors.text-highlight');
}
}
&.full-width tbody {
border: 0;
}
&.chooser {
tbody .parent-page {
font-size: 1.15em;
background-color: theme('colors.border-furniture');
}
tbody .parent-page .title {
a {
display: inline-block;
}
.w-status--label {
border: 1px solid;
}
}
tbody .title a {
@include transition(none);
2015-11-03 13:15:33 +01:00
display: block;
}
tbody tr:hover {
background-color: theme('colors.surface-button-hover');
color: theme('colors.text-button');
.title a,
.title a:hover,
.title label {
color: theme('colors.text-button');
}
.parent a {
color: theme('colors.text-button');
}
.w-status {
border-color: theme('colors.text-button');
}
}
2014-07-24 16:11:45 +02:00
tbody tr.disabled td {
opacity: 0.25;
}
2015-11-03 13:15:33 +01:00
tbody tr.disabled td.children {
opacity: 1;
}
2015-11-03 13:15:33 +01:00
tbody tr.disabled:hover {
background-color: inherit;
color: inherit;
.title {
2015-11-03 13:15:33 +01:00
cursor: not-allowed;
}
2015-11-03 13:15:33 +01:00
.w-status {
border-color: inherit;
}
}
}
2015-11-03 13:15:33 +01:00
&.small tbody tr {
font-size: 1em;
}
2015-11-03 13:15:33 +01:00
&.full-width .divider td {
padding-inline-start: 20px;
}
2015-11-03 13:15:33 +01:00
// specific columns
.bulk {
padding-inline-end: 0;
2015-11-03 13:15:33 +01:00
label {
font-size: 1em;
display: block;
width: 100%;
position: relative;
}
label span {
@include visuallyhidden();
}
input {
margin-top: 3px;
}
}
.title {
word-break: break-word;
.title-wrapper,
h2 {
2022-07-12 06:46:19 +02:00
@apply w-label-1;
display: inline;
margin: 0;
vertical-align: middle;
2015-11-03 13:15:33 +01:00
a {
color: inherit;
text-decoration: none;
2015-11-03 13:15:33 +01:00
// stylelint-disable max-nesting-depth
&:hover {
color: theme('colors.text-link-default');
}
}
}
.icon.initial {
margin: 3px 0.3em 0 0;
vertical-align: top;
}
}
2014-03-07 16:41:17 +01:00
.actions {
2023-09-14 23:42:35 +02:00
float: right;
font-size: 0.8rem;
2023-09-14 23:42:35 +02:00
margin: 0;
a {
text-decoration: none;
}
> li {
float: left;
padding: 0 0.5em 0 0;
vertical-align: middle;
}
}
2022-07-12 06:46:19 +02:00
&--inline-actions td.title {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.5rem;
.title-wrapper {
margin-inline-end: 2.5em;
}
.w-status {
2022-07-12 06:46:19 +02:00
margin: 0;
}
}
2015-11-19 07:05:57 +01:00
&--inline-actions .actions {
display: inline-block;
2015-11-03 13:15:33 +01:00
margin-top: 0;
vertical-align: inherit;
2022-07-12 06:46:19 +02:00
li {
margin-bottom: 0;
}
.button {
vertical-align: inherit;
}
}
2015-11-19 07:05:57 +01:00
2021-07-20 19:41:04 +02:00
.moderate-actions form {
float: left;
margin: 0 1em 1em 0;
}
.children,
.no-children {
padding: 0;
a {
display: block;
2023-09-14 23:42:35 +02:00
padding: 0;
}
}
.children a {
color: theme('colors.text-button-outline-default');
2015-11-03 13:15:33 +01:00
display: block;
text-align: center;
.icon {
width: 3rem;
height: 3rem;
}
}
2014-07-24 16:11:45 +02:00
.no-children a {
color: theme('colors.text-button-outline-default');
display: block;
text-align: center;
line-height: 3rem;
.icon {
width: 1.5rem;
height: 1.5rem;
}
&:hover,
&:focus {
color: theme('colors.text-button-outline-default');
}
&:focus {
opacity: 1; //opacity is already changed on hover on the parent tr
}
}
2014-07-24 16:11:45 +02:00
&.small .children a .icon {
width: 30px;
height: 30px;
}
th.ord {
text-align: center;
2015-11-03 13:15:33 +01:00
.icon {
2023-03-31 05:46:34 +02:00
width: 1rem;
height: 1rem;
vertical-align: middle;
2023-03-31 05:46:34 +02:00
margin-inline-end: 2px;
}
2014-07-24 16:11:45 +02:00
&--active a,
a:hover {
color: theme('colors.text-button-outline-default');
}
}
.handle {
cursor: move;
width: 20px;
color: theme('colors.icon-secondary');
&:hover {
color: theme('colors.icon-secondary-hover');
}
}
.ui-sortable-helper {
border: 1px dashed theme('colors.border-field-default');
border-width: 1px 0;
2015-11-03 13:15:33 +01:00
td {
display: none;
}
.ord,
.title {
display: table-cell;
}
}
table .no-results-message {
padding-inline-start: 20px;
}
.unpublished .title-wrapper {
opacity: 0.7;
}
2015-11-03 13:15:33 +01:00
.w-status {
2022-07-12 06:46:19 +02:00
margin: 0;
margin-inline: 0;
}
&.images img {
@include transition(border-color 0.2s ease);
border: 3px solid theme('colors.surface-page');
}
}
.image-choice {
// Force the link to be displayed as a block, so its focus outline has the right shape.
display: block;
color: inherit;
overflow-wrap: break-word;
word-wrap: break-word;
}
// stylelint-disable-next-line no-duplicate-selectors
ul.listing {
border-top: 1px dashed theme('colors.border-field-default');
margin-bottom: 2em;
}
2015-11-03 13:15:33 +01:00
table.listing {
width: 100%;
}
2022-12-21 15:40:04 +01:00
// Use consistent spacing to the left and right of the header.
.page-explorer .w-slim-header {
@include media-breakpoint-up(md) {
padding-inline-end: theme('spacing.6');
}
}
.page-explorer .w-breadcrumbs {
li[hidden] ~ li:last-child,
li:only-child {
a {
font-size: theme('fontSize.18');
font-weight: theme('fontWeight.extrabold');
@include media-breakpoint-up(md) {
font-size: theme('fontSize.30');
}
}
}
}
2014-03-07 16:41:17 +01:00
.page-explorer .listing {
position: relative;
.table-headers,
thead tr {
height: 35px;
2015-11-03 13:15:33 +01:00
.title {
padding-inline-start: 0;
2014-03-07 16:41:17 +01:00
}
}
2015-11-03 13:15:33 +01:00
tbody .title {
padding-inline-start: 0;
2014-03-07 16:41:17 +01:00
}
}
.pagination {
text-align: center;
2015-11-03 13:15:33 +01:00
p {
margin: 0;
}
2015-11-03 13:15:33 +01:00
ul {
@include unlist();
margin-top: -1.7em;
}
2015-11-03 13:15:33 +01:00
li {
line-height: 1em;
}
2015-11-03 13:15:33 +01:00
.prev {
float: left;
}
2015-11-03 13:15:33 +01:00
.next {
float: right;
}
}
.listing.full-width + .pagination {
2014-02-05 13:19:20 +01:00
margin-top: 3em;
border-top: 1px dashed theme('colors.border-furniture');
2015-11-03 13:15:33 +01:00
padding: 2em 50px 0;
2014-02-05 13:19:20 +01:00
}
2015-11-03 13:15:33 +01:00
// listing filters
.listing-filter {
@include clearfix();
background-color: theme('colors.surface-header');
border-width: 1px 0;
margin: 3em 0;
}
2015-11-03 13:15:33 +01:00
.filter-title {
float: left;
font-size: 0.95em;
padding: 1em;
2015-11-03 13:15:33 +01:00
margin: 0 1em 0 0;
background-color: theme('colors.border-furniture');
}
2015-11-03 13:15:33 +01:00
.filter-options {
@include unlist();
@include clearfix();
overflow: hidden;
li {
padding: 0.8em;
float: left;
}
&__icon {
width: 1em;
height: 1em;
margin-inline-end: 0.2em;
vertical-align: middle;
position: relative;
top: -1px;
}
}
@include media-breakpoint-up(sm) {
.listing {
&.horiz {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
align-items: flex-end;
justify-items: initial;
}
2015-11-03 13:15:33 +01:00
&.images {
border: 0;
2015-11-03 13:15:33 +01:00
> li {
padding: 1.5em;
width: auto;
height: auto;
text-align: center;
margin-top: -1px;
border: 0;
.bulk-action-checkbox {
2015-11-03 13:15:33 +01:00
float: left;
margin: -0.5em 0.5em 0.5em -0.75em;
}
2015-11-03 13:15:33 +01:00
.bulk-action-checkbox + .image-choice {
clear: both;
margin-top: 1em;
}
2015-11-03 13:15:33 +01:00
.image {
text-align: center;
height: 180px;
2015-11-19 07:05:57 +01:00
&:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-inline-end: -0.25em;
}
2015-11-19 07:05:57 +01:00
img {
display: inline-block;
vertical-align: middle;
}
}
2015-11-03 13:15:33 +01:00
&:hover {
img {
border-color: theme('colors.border-button-outline-default');
}
}
}
}
2021-10-10 19:13:55 +02:00
.bulk-action-checkbox {
opacity: 0;
2015-11-03 13:15:33 +01:00
&.show,
&:checked {
opacity: 1;
}
}
.no-children {
2015-11-03 13:15:33 +01:00
border-color: transparent;
a {
opacity: 0;
}
}
2014-02-05 12:10:09 +01:00
tr:hover,
tr:focus-within {
.no-children a,
.bulk-action-checkbox {
opacity: 1;
2014-02-05 12:10:09 +01:00
}
}
2014-02-05 12:10:09 +01:00
// used on the image listing
2021-10-10 19:13:55 +02:00
li:hover,
li:focus-within {
.bulk-action-checkbox {
opacity: 1;
2014-02-05 12:10:09 +01:00
}
}
2014-02-05 12:10:09 +01:00
tr:hover .children {
background-color: theme('colors.text-button-outline-default');
.icon {
color: theme('colors.surface-page');
2014-02-05 12:10:09 +01:00
}
}
td.children:hover {
background-color: theme('colors.text-button-outline-default');
}
table .no-results-message {
padding-inline-start: 50px;
}
2014-02-05 12:10:09 +01:00
&.full-width td:first-child,
&.full-width th:first-child {
padding-inline-start: 30px;
padding-inline-end: 30px;
}
// Reduce padding on sort order controls so total width matches previous state
&.full-width td.ord,
&.full-width th.ord {
padding-inline-end: 20px;
padding-inline-start: 20px;
}
&.full-width .divider td {
padding-inline-start: 50px;
}
}
}
2015-11-19 07:05:57 +01:00
// State
.listing__item--active {
> .actions {
visibility: visible;
}
}
// stylelint-disable no-duplicate-selectors
2015-11-19 07:05:57 +01:00
2015-11-03 13:15:33 +01:00
// Transitions
.listing {
thead .dropdown ul {
@include transition(none);
}
2015-11-03 13:15:33 +01:00
.children,
.no-children {
@include transition(background-color 0.2s ease);
}
.children a,
.no-children a {
@include transition(all 0.2s ease);
}
2015-11-03 13:15:33 +01:00
}
// Ordering
td.ord {
// Align with the row's title text, and the column's label.
vertical-align: top;
.handle {
width: 100%;
text-align: center;
}
}
table.listing {
th.ordered {
color: theme('colors.text-link-default');
}
}