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.

Is your feature request related to a problem? Please describe.

Modes are only applied to colors. Light/dark modes are the most common use case. However, I am frustrating when I have to manage a theme where you additionally have space modes such as “Comfortable”, “Cozy”, or “Compact”.

Describe the solution you’d like

I would like to see a better integration of Modes for other theme keys/CSS properties.

Describe alternatives you’ve considered

One solution to this is to setup space theme key as an object like colors, and have a modes object in it.

const theme = {
  // More theme keys...
  space: {
    px: "1px",
    "0": "0",
    "1": "0.25rem",
    "2": "0.5rem",
    "3": "0.75rem",
    "4": "1rem",
    "5": "1.25rem",
    "6": "1.5rem",
    "8": "2rem",
    "10": "2.5rem",
    "12": "3rem",
    "16": "4rem",
    "20": "5rem",
    "24": "6rem",
    "32": "8rem",
    "40": "10rem",
    "48": "12rem",
    "56": "14rem",
    "64": "16rem",
    modes: {
      comfortable: {},
      cozy: {},
      compact: {}
    }
};

Additional context

It would be awesome to design an API not only for colors and sizes but for everything (other theme keys).

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
jxnblkcommented, Dec 10, 2019

Thanks, we discussed supporting this early on, but decided against it. Instead of adding additional nested modes to each scale, we think it’s more flexible to allow switching the top-level theme for more bespoke cases like this. Currently, the way Theme UI uses state makes this less than ideal, but in v0.3.0, we’re planning on removing state so that you can keep multiple themes or modes of themes in state above the ThemeProvider and have fine-grained control over how that works. We might add and additional component to make this easier to implement, but it likely won’t look exactly like the color modes API

3reactions
jxnblkcommented, Jan 2, 2020

Closing this out because v0.3 will allow for dynamic themes passed to ThemeProvider

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rethinking Generative Mode Coverage: A Pointwise ...
Abstract. Many generative models have to combat missing modes. The conventional wisdom to this end is by reducing through training a statistical distance...
Read more >
Using Constrained Zero-G Mode - Rethink Robotics
This tutorial shows how to manipulate Sawyer in Zero-G mode with the arm motion constrained to a plane, translational axis, rotational axis, ...
Read more >
[1902.04697] Rethinking Generative Mode Coverage - arXiv
Rethinking this problem from a game-theoretic perspective, we show that a complete mode coverage is firmly attainable. If a generative model can approximate...
Read more >
Consistency guarantees - RethinkDB
Three settings control consistency and durability in RethinkDB: write acknowledgements and durability per table, and the query read mode.
Read more >
Acceleration Mode: Retail Trends That Will Define 2022
A RETHINK Retail exclusive report on the retail trends that will define 2022. Download to get the scoop on: Why 72% of Gen...
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