MediaWiki:CustomDatatable.css: Difference between revisions

From The Seven Sages of Rome
No edit summary
Tag: Reverted
No edit summary
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Modern ShadCN DataTable Styling */
.dt-container:not(.dts) {
 
border-radius: 0.75rem !important;
/* Base table styles */
.dataTables_wrapper {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: hsl(222.2 47.4% 11.2%);
  font-size: 14px;
}
 
.dataTables_wrapper table.dataTable {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  border-radius: 8px;
  overflow: hidden;
}
 
/* Header styling */
.dataTables_wrapper table.dataTable thead {
  background-color: hsl(210 40% 98%);
  border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
}
 
.dataTables_wrapper table.dataTable thead th {
  padding: 12px 16px;
  font-weight: 500;
  text-align: left;
  font-size: 13px;
  color: hsl(215.4 16.3% 46.9%);
  border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
  background-color: hsl(210 40% 98%);
  white-space: nowrap;
}
 
/* Sortable columns */
.dataTables_wrapper table.dataTable thead th.sorting,
.dataTables_wrapper table.dataTable thead th.sorting_asc,
.dataTables_wrapper table.dataTable thead th.sorting_desc {
  cursor: pointer;
  position: relative;
  padding-right: 30px;
}
 
.dataTables_wrapper table.dataTable thead th.sorting:after,
.dataTables_wrapper table.dataTable thead th.sorting_asc:after,
.dataTables_wrapper table.dataTable thead th.sorting_desc:after {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 12px;
}
 
.dataTables_wrapper table.dataTable thead th.sorting:after {
  content: "⇅";
}
 
.dataTables_wrapper table.dataTable thead th.sorting_asc:after {
  content: "↑";
  opacity: 1;
}
 
.dataTables_wrapper table.dataTable thead th.sorting_desc:after {
  content: "↓";
  opacity: 1;
}
 
/* Body rows */
.dataTables_wrapper table.dataTable tbody tr {
  border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
  transition: background-color 0.15s ease;
}
 
.dataTables_wrapper table.dataTable tbody tr:hover {
  background-color: hsl(210 40% 98%);
}
 
.dataTables_wrapper table.dataTable tbody tr:last-child {
  border-bottom: none;
}
 
.dataTables_wrapper table.dataTable tbody td {
  padding: 16px;
  vertical-align: middle;
  color: hsl(222.2 47.4% 11.2%);
}
 
/* Selected rows */
.dataTables_wrapper table.dataTable tbody tr.selected {
  background-color: hsl(210 40% 96.1%);
}
 
/* Checkboxes */
.dataTables_wrapper table.dataTable input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  border-radius: 4px;
  cursor: pointer;
  accent-color: hsl(222.2 47.4% 11.2%);
}
 
/* Badge styling for tags */
.dataTables_wrapper .badge,
.dataTables_wrapper .tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  background-color: hsl(210 40% 96.1%);
  color: hsl(222.2 47.4% 11.2%);
  border: 1px solid hsl(214.3 31.8% 91.4%);
}
 
/* Status indicators */
.dataTables_wrapper .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: hsl(215.4 16.3% 46.9%);
  font-size: 14px;
}
 
.dataTables_wrapper .status-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
 
/* Priority indicators */
.dataTables_wrapper .priority {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: hsl(215.4 16.3% 46.9%);
}
 
.dataTables_wrapper .priority-arrow {
  font-size: 16px;
  line-height: 1;
}
 
/* DataTables controls wrapper */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: 16px 0;
  color: hsl(215.4 16.3% 46.9%);
}
 
/* Search/filter input */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid hsl(214.3 31.8% 91.4%);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  margin-left: 8px;
  outline: none;
  transition: border-color 0.15s ease;
}
 
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: hsl(222.2 47.4% 11.2%);
  box-shadow: 0 0 0 2px hsl(222.2 47.4% 11.2% / 0.1);
}
 
/* Length selector */
.dataTables_wrapper .dataTables_length select {
  border: 1px solid hsl(214.3 31.8% 91.4%);
  border-radius: 6px;
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  margin: 0 8px;
  outline: none;
  background-color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
 
/* Pagination */
.dataTables_wrapper .dataTables_paginate {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
 
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid hsl(214.3 31.8% 91.4%);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 2px;
  font-size: 14px;
  background-color: white;
  color: hsl(222.2 47.4% 11.2%);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-block;
}
 
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: hsl(210 40% 96.1%);
  border-color: hsl(214.3 31.8% 85%);
}
 
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: hsl(222.2 47.4% 11.2%);
  color: white;
  border-color: hsl(222.2 47.4% 11.2%);
}
 
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
 
/* Info text */
.dataTables_wrapper .dataTables_info {
  font-size: 14px;
  color: hsl(215.4 16.3% 46.9%);
}
 
/* Processing indicator */
.dataTables_wrapper .dataTables_processing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  border-radius: 8px;
  padding: 16px 24px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
 
/* Empty state */
.dataTables_wrapper .dataTables_empty {
  text-align: center;
  padding: 48px 16px !important;
  color: hsl(215.4 16.3% 46.9%);
  font-size: 14px;
}
}


/* Toolbar buttons (if you add action buttons) */
.cc-card-body--table .dt-container {
.dataTables_wrapper .dt-buttons {
border: none !important;
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
}


.dataTables_wrapper .dt-button {
.cc-card-body--table .dt-container {
  border: 1px solid hsl(214.3 31.8% 91.4%);
   font-size: 0.835rem !important;  
  border-radius: 6px;
   font-weight: 500 !important;
  padding: 8px 16px;
   color: #555 !important;
   font-size: 14px;
   letter-spacing: 0.01em !important;
   background-color: white;
   color: hsl(222.2 47.4% 11.2%);
   cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
}


.dataTables_wrapper .dt-button:hover {
.dt-container input.dt-input,select.dt-input,button.dtsp-showAll,button.dtsp-collapseAll {
  background-color: hsl(210 40% 96.1%);
border-radius: 0.5rem !important;
  border-color: hsl(214.3 31.8% 85%);
}
}


/* Responsive adjustments */
.dt-container button.dtsp-showAll,button.dtsp-collapseAll {
@media (max-width: 768px) {
margin-left: 0.5rem !important;
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: left;
    margin-bottom: 16px;
  }
 
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    text-align: center;
    justify-content: center;
  }
}
}


/* Scrolling table on mobile */
dataTable.display > tbody > tr > .sorting_1 {
.dataTables_wrapper .dataTables_scroll {
background-color: #f8f8f8 !important;
  overflow-x: auto;
}
}


/* Three-dot menu button (add to your HTML if needed) */
.dataTable.display > tbody > tr:nth-child(odd) > * {
.dataTables_wrapper .action-menu {
background-color: #f5f5f3 !important;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  font-size: 18px;
  color: hsl(215.4 16.3% 46.9%);
}
}


.dataTables_wrapper .action-menu:hover {
.dtsp-emptyMessage {
  background-color: hsl(210 40% 96.1%);
display: none !important;
}
}

Latest revision as of 09:44, 26 February 2026

.dt-container:not(.dts) {
	border-radius: 0.75rem !important;
}

.cc-card-body--table .dt-container {
	border: none !important;
}

.cc-card-body--table .dt-container {
  font-size: 0.835rem !important; 
  font-weight: 500 !important;
  color: #555 !important;
  letter-spacing: 0.01em !important;
}

.dt-container input.dt-input,select.dt-input,button.dtsp-showAll,button.dtsp-collapseAll {
	border-radius: 0.5rem !important;
}

.dt-container button.dtsp-showAll,button.dtsp-collapseAll {
	margin-left: 0.5rem !important;
}

dataTable.display > tbody > tr > .sorting_1 {
	background-color: #f8f8f8 !important;
}

.dataTable.display > tbody > tr:nth-child(odd) > * {
	background-color: #f5f5f3 !important;
}

.dtsp-emptyMessage {
	display: none !important;
}