question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support custom breakpoints

See original GitHub issue

Thanks for making this module! I’ve been hoping to use the newer releases of Tailwind with Emotion.

I’m trying to use my custom @screen breakpoints with the macro, but can only seem to get the default breakpoints to work.

I’m using the approach mentioned by @llaski on this thread, by calling the _utils.stringifyScreen function. I recognize that this may not be intended as a public function, but it does work for the default breakpoints. Is there a way to have it recognize my custom breakpoints defined under my Tailwind config?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ben-rogersoncommented, Feb 20, 2020

If you’re using them in a styled block then it’s a little more complex. You’d need to import the config and grab the screen sizes and work with them manually. I understand this isn’t ideal so I’ll provide a similar function in the near future.

For now, something like this should work:

// tailwind.helpers.js
import _get from 'lodash/get';
import resolveConfig from 'tailwindcss/resolveConfig';
import tailwindConfig from '~./../../tailwind.config.js';
const { theme } = resolveConfig(tailwindConfig);

const SCREEN = _get(theme, 'borderColor.screens');

export { SCREEN };
1reaction
ben-rogersoncommented, Feb 21, 2020

I’ve run into that issue before and think I fixed it with the advice on that issue.

Adding sourceType: 'unambiguous' to my Babel config fixed this by allowing me to import a module.exports.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Additional custom breakpoints | Elementor
Breakpoints are used when designing your website to be responsive across all devices. Breakpoints use an additional set of CSS rules to apply...
Read more >
Custom Breakpoints for Elementor – WordPress plugin
This Custom Breakpoint plugin will help you to set a specific property of elements for your custom made breakpoint. Just install and activate...
Read more >
Support custom breakpoints · Issue #25 · nandorojo/dripsy
I think I know a simpler solution to this. Just use a static breakpoints variable that gets mutated in render code of the...
Read more >
How To Use CSS Breakpoints For Responsive Design
CSS media query breakpoints can be selected based on the device on which the website is being rendered. However, this is not a...
Read more >
Breakpoints · Bootstrap v5.0
Breakpoints are customizable widths that determine how your responsive layout behaves across device or viewport sizes in Bootstrap.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found