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.

[Core] There should be a more sophisticated styling solution.

See original GitHub issue

@callemall/material-ui please leave some input here when you can 👍

We need to decide on a styling solution for 0.16.0 that will help address long standing issues. Outside of performance issues, there are hacks and props all over the place to make up for the fact that we are missing out on some of the powerful features in CSS that cannot be used with inline styles – pseudo classes, media queries (without matchmedia), etc.

From what I understand, the general consensus is that we want a JS style solution that has the capability to write styles to an actual stylesheet in the DOM.

Here are a few of the maintained solutions that do this: https://github.com/rofrischmann/react-look https://github.com/Khan/aphrodite https://github.com/jsstyles/react-jss

Here are some points we need to consider when implementing the new solution (IMO):

  1. Does it align with our goals? (lightly touched on above)
  2. Implementing media queries that follow the high level breakpoints detailed in the spec that can be easily used in components with a stylesheet mixin (or whatever the implementation we use calls them). If we’re overhauling the style implementation, it is the opportune moment to plant the seed for much better responsive UI support in this library. It would be even better if these tools are available in userland too 👍
  3. Should we create layout helper components and/or mixins to help unify flexbox layout implementations across the lib?
  4. Does theming needs to change to maximize best use of the new solution? While theming is one component of consistent styling, we should also look into creating variables for many of the common material styles such as global keylines/font sizes/spacing/margins/etc. I strongly recommend we improve our typography consistency by creating predefined type styles matching the material-ui typography guide, and try match up component elements like titles etc as best possible to these global type style variables as a default.
  5. If using a library as large as react-look, try and see how we can import modules for a minimal build size. The full build size is 16kb gzipped which is fairly large. It would be great if we can minimize the impact on build size. I realized that 9kb of that is https://github.com/rofrischmann/inline-style-prefixer which we already use… 😄

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:29
  • Comments:100 (55 by maintainers)

github_iconTop GitHub Comments

27reactions
nehalbhanushalicommented, Aug 8, 2016

Is the styling solution finalized?

21reactions
nathanmarkscommented, Apr 22, 2016

@chrismcv My personal opinion is that we definitely need to leverage the solution to remove these super specific props we’re seeing proposed: [TextField] add floatingLabelFocusStyle prop #4043

Before we know it, people are going to be asking for props for subcomponent styles for every possible focus/active/hover/whatever state.

I see so many issues that are “how to style XXXX”, “can’t style XXX inside YYYY”, “add somethingInsideToTheLeftButSlightlyMiddleFocusHoverActiveStyle prop to XXX please”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing MUI Core v5.0
It had become clear that design (aesthetic, UX) and DX were key to ... Could we move the style descriptions right where we...
Read more >
Advanced form styling - Learn web development | MDN
For now, the best solution is to learn more about the way the ... In this article, we will see what can be...
Read more >
4 Types of Innovators Every Organization Needs
The authors' research distills four key innovation styles that ... So, a lack of generators makes it more likely that an organization will...
Read more >
SAFe for Lean Enterprises - Scaled Agile Framework
It also helps create cultures that are more productive, ... solutions for the right customers at the right time; they must balance their...
Read more >
5 Types of Conflict Styles1
Sometimes the compromising conflict handling mode is utilized when a temporary solution to a more complex issue is required. There may be 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