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.

Overall system mixin strategy

See original GitHub issue

Opening this to get consensus on how to proceed.

It feels to me like the overall design of what system props are available on which components is unintuitive — but it’s also possible I don’t have a good mental model of the overall strategy with regard to primitives.

Here’s some of the things that bit me in the past hour:

  • Box has bg but Flex doesn’t
  • Flex has top/bottom but not left/right
  • Typography supports as aliased as element but nothing else does

A good first step I think would be to move the flex mixin into Box, and then have Flex just become Box with display: flex as default.

Additionally I’d be interested in what is required to support as universally on our primitive elements.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dzucconicommented, May 29, 2020

https://styled-system.com/guides/migrating/

Number values are no longer converted to strings with px units. Most CSS-in-JS libraries now handle this, but if you need to use string values with units, provide them in your theme object and in prop values.

1reaction
zephraphcommented, May 29, 2020

While I agree with the direction I firmly believe we shouldn’t do it on the current version of styled-systems.

We desperately need to upgrade. The latest version of styled-system has a drastically reduced set of helpers that makes concerted effort towards providing consistent props a relatively trivial matter.

I know it’s gonna be hell to upgrade, but we really should. Take a look at my WIP pr. I’ll try to get back around to that next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to Mixins Understanding Mixin Architecture - GitHub
Mixin is a trait/mixin and bytecode weaving framework for Java using ASM ... this presence in the class's overall external appearance.
Read more >
1. Beautiful Mixins - Beautiful JavaScript [Book] - O'Reilly
Traditionally, a mixin is a class that defines a set of functions that would otherwise be defined by a concrete entity (a person,...
Read more >
Kevin Dew — A Cleaner Backbone Mixin Strategy
This approach only works in a hierarchical system (and even then is a bit flaky) and if we apply that to mixins then...
Read more >
Strategy VS Mixin (additional article) -- dynamically mixing ...
During runtime, The Quackable interface is dynamically mixed into the QuackModule by enabling Mallard Duck to dynamically implement the ...
Read more >
A fresh look at JavaScript Mixins
However delegation is so convenient that sometimes it actually works against structural discipline in your code; moreover the syntax can get a ...
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