Adding breakpoints in newUtilities #1469
adrianjacob
started this conversation in
General
Replies: 3 comments
-
Try this: plugins: [
({ addComponents, theme }) => {
const newComponents = {
".btn": {
borderRadius: theme("borderRadius.full"),
paddingLeft: theme("spacing.8"),
paddingRight: theme("spacing.8"),
height: theme("spacing.10"),
fontWeight: theme("fontWeight.semibold"),
borderWidth: theme("borderWidth.0"),
cursor: theme("cursor.pointer"),
[`@media min-width ${theme("screens.lg")}`]: {
paddingLeft: theme("spacing.12"),
paddingRight: theme("spacing.12")
}
}
};
addComponents(newComponents);
}
] Or this: plugins: [
({ addComponents, theme }) => {
const newComponents = {
".btn": {
borderRadius: theme("borderRadius.full"),
paddingLeft: theme("spacing.8"),
paddingRight: theme("spacing.8"),
height: theme("spacing.10"),
fontWeight: theme("fontWeight.semibold"),
borderWidth: theme("borderWidth.0"),
cursor: theme("cursor.pointer"),
'@screen lg': {
paddingLeft: theme("spacing.12"),
paddingRight: theme("spacing.12")
}
}
};
addComponents(newComponents);
}
] EDIT: Sorry just realized you're using |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the response. I now get the following"
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Ah - just seen your edit - will try :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using a combination of tailwind, twin.macro and styled components in gatsby.
I have a bunch of newUtilities in my tailwind.config.js file such as the following (which work perfectly)
However, I want to add some more padding at the 'lg' screen break size but i cant work it out (pseudo code below)
Any suggestions much appreciated as I have been pulling my hair out for 1/2 a day.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions