mirror of
https://github.com/tabler/tabler.git
synced 2025-12-21 17:34:25 +04:00
feat: Add print styles using media-print mixin (#2531)
This commit is contained in:
5
.changeset/media-print-mixin.md
Normal file
5
.changeset/media-print-mixin.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tabler/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Added `media-print` mixin and print styles to hide interactive components during printing.
|
||||||
@@ -14,7 +14,7 @@ body {
|
|||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
|
||||||
@media print {
|
@include media-print {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
padding: $footer-padding-y 0;
|
padding: $footer-padding-y 0;
|
||||||
color: $footer-color;
|
color: $footer-color;
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-transparent {
|
.footer-transparent {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
@media print {
|
@include media-print {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,3 +66,12 @@
|
|||||||
border-color: rgba(var(--#{$prefix}primary-rgb), 0.25);
|
border-color: rgba(var(--#{$prefix}primary-rgb), 0.25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Print styles
|
||||||
|
//
|
||||||
|
@mixin media-print {
|
||||||
|
@media print {
|
||||||
|
@content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -216,6 +216,10 @@
|
|||||||
bottom: 1rem;
|
bottom: 1rem;
|
||||||
left: 1rem;
|
left: 1rem;
|
||||||
box-shadow: var(--#{$prefix}shadow-dropdown);
|
box-shadow: var(--#{$prefix}shadow-dropdown);
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -277,10 +281,18 @@
|
|||||||
&.show {
|
&.show {
|
||||||
color: var(--#{$prefix}primary);
|
color: var(--#{$prefix}primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-actions {
|
.btn-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-animate-icon {
|
.btn-animate-icon {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.card {
|
.card {
|
||||||
@include transition(transform $transition-time ease-out, opacity $transition-time ease-out, box-shadow $transition-time ease-out);
|
@include transition(transform $transition-time ease-out, opacity $transition-time ease-out, box-shadow $transition-time ease-out);
|
||||||
|
|
||||||
@media print {
|
@include media-print {
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
@@ -341,7 +341,7 @@ Stacked card
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@include media-print {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,10 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
opacity: var(--#{$prefix}btn-close-disabled-opacity);
|
opacity: var(--#{$prefix}btn-close-disabled-opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @mixin btn-close-white() {
|
// @mixin btn-close-white() {
|
||||||
|
|||||||
@@ -14,6 +14,10 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-item {
|
.dropdown-item {
|
||||||
|
|||||||
@@ -65,3 +65,9 @@
|
|||||||
max-width: none;
|
max-width: none;
|
||||||
margin: 0 $modal-dialog-margin;
|
margin: 0 $modal-dialog-margin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal {
|
||||||
|
@include media-print {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
.offcanvas {
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.offcanvas-header {
|
.offcanvas-header {
|
||||||
border-bottom: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
|
border-bottom: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
gap: var(--#{$prefix}pagination-gap);
|
gap: var(--#{$prefix}pagination-gap);
|
||||||
line-height: var(--#{$prefix}body-line-height);
|
line-height: var(--#{$prefix}body-line-height);
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-link {
|
.page-link {
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
.popover {
|
.popover {
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
padding-bottom: $table-th-padding-y;
|
padding-bottom: $table-th-padding-y;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
@media print {
|
@include media-print {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
button[data-bs-dismiss="toast"] {
|
button[data-bs-dismiss="toast"] {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@each $state, $value in $theme-colors {
|
@each $state, $value in $theme-colors {
|
||||||
|
|||||||
@@ -7,4 +7,8 @@
|
|||||||
> * {
|
> * {
|
||||||
margin: 0 .5rem;
|
margin: 0 .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include media-print {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user