Skip to content
This repository was archived by the owner on Sep 11, 2021. It is now read-only.

Commit 39405bc

Browse files
Print theming
1 parent 6b8682a commit 39405bc

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

index.js

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
3737
borderRadius: options.borderRadius,
3838
backgroundColor: options.backgroundColor,
3939
userSelect: 'none',
40+
colorAdjust: 'exact',
4041
'&:focus': {
4142
outline: 'none',
4243
boxShadow: options.focusShadow,
@@ -53,12 +54,14 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
5354
backgroundRepeat: 'no-repeat',
5455
},
5556
'&::-ms-check': {
56-
color: 'transparent', // Hide the check
57-
background: 'inherit',
58-
borderColor: 'inherit',
59-
borderRadius: 'inherit',
60-
borderWidth: options.borderWidth,
61-
}
57+
'@media not print': {
58+
color: 'transparent', // Hide the check
59+
background: 'inherit',
60+
borderColor: 'inherit',
61+
borderRadius: 'inherit',
62+
borderWidth: options.borderWidth,
63+
}
64+
},
6265
},
6366
'.form-radio': {
6467
appearance: 'none',
@@ -71,6 +74,7 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
7174
borderRadius: '50%',
7275
backgroundColor: options.backgroundColor,
7376
userSelect: 'none',
77+
colorAdjust: 'exact',
7478
'&:focus': {
7579
outline: 'none',
7680
boxShadow: options.focusShadow,
@@ -87,12 +91,14 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
8791
backgroundRepeat: 'no-repeat',
8892
},
8993
'&::-ms-check': {
90-
color: 'transparent', // Hide the dot
91-
background: 'inherit',
92-
borderColor: 'inherit',
93-
borderRadius: 'inherit',
94-
borderWidth: options.borderWidth,
95-
}
94+
'@media not print': {
95+
color: 'transparent', // Hide the dot
96+
background: 'inherit',
97+
borderColor: 'inherit',
98+
borderRadius: 'inherit',
99+
borderWidth: options.borderWidth,
100+
},
101+
},
96102
},
97103
'.form-input, .form-textarea, .form-multiselect': {
98104
appearance: 'none',
@@ -125,8 +131,16 @@ module.exports = function ({ addUtilities, addComponents, theme }) {
125131
backgroundPosition: `right ${options.selectIconOffset} center`,
126132
backgroundRepeat: 'no-repeat',
127133
backgroundSize: `${options.selectIconSize} ${options.selectIconSize}`,
134+
colorAdjust: 'exact',
128135
'&::-ms-expand': {
129-
display: 'none',
136+
border: 'none', // The select padding is causing some whitespace around the chevron which looks weird with a border
137+
color: defaultTheme.colors.gray[500], // Chevron color
138+
'@media not print': {
139+
display: 'none',
140+
},
141+
},
142+
'@media print and (-ms-high-contrast: active), print and (-ms-high-contrast: none)': {
143+
paddingRight: options.horizontalPadding, // Fix padding for print in IE
130144
},
131145
'&:focus': {
132146
outline: 'none',

0 commit comments

Comments
 (0)