Rethink modes
See original GitHub issueIs 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:
- Created 4 years ago
- Reactions:4
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 APIClosing this out because v0.3 will allow for dynamic themes passed to
ThemeProvider