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.

Breakpoint objects/aliases

See original GitHub issue

Hi there, is the below Styled System syntax supported in Theme UI? It doesn’t appear to be working when using the pragma like this: (none of the styles are being applied at all)

<div 
sx={{
 bg: { _: "green", sm: "red", md: "blue" }, 
}} >

Thanks!

https://github.com/styled-system/styled-system/blob/master/docs/responsive-styles.md#using-objects

Issue Analytics

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

github_iconTop GitHub Comments

10reactions
oheyjessecommented, Jul 8, 2020

@jxnblk We’re using theme-ui in our shared component library in our organisation and we really appreciate the { _: '12px', xl: '16px' } object style when using styled-system props. We get quite a few questions from devs regarding why this syntax doesn’t exist with the sx prop.

It’s a really nice syntax, as if you add/remove/change breakpoints, you don’t need to update any arrays. It’s also a lot more concise to code. We’d love to see it added 😃

5reactions
mrluboscommented, Nov 17, 2020

I share the sentiment with others @jxnblk. While breakpoints array makes for a concise definition and usage, any refactoring can quickly get out of hand when these values shift by 1. I am not sure what the syntax would look like, but I’d personally find it better to explicitly define the array, e.g. [query.sm, query.md, query.lg].

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugger Data Model Function Aliases - Windows drivers
Function aliases are a quick unique short name by which a user of the debugger can access functionality defined in a debugger extension....
Read more >
LLDB Where are the builtin aliases - debugging - Stack Overflow
Set a breakpoint using a regular expression to specify the location, where <linenum> is in decimal and <address> is in hex.
Read more >
Debugging Scripts - Zugg Software
You can set Object Breakpoints on Aliases, Triggers, and Variables. To set an object breakpoint, go into the Settings Editor. Right-click on the...
Read more >
Responsive Styles - Chakra UI
You can also define responsive values with breakpoint aliases in an object. Any undefined alias key will define the base, non-responsive value.
Read more >
Alias 2022 Help | Debugging a plug-in in Windows | Autodesk
Invoke the plug-in and the appropriate code path to hit the breakpoint. In the Microsoft Visual C++ application: Step through the source interactively....
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