-
Notifications
You must be signed in to change notification settings - Fork 9
Theming in Atom #4
Conversation
I'm really happy to see you exploring this, and I like the direction. Some thoughts in reaction to this (not super well organized).
I'm really glad you're looking at this. I think it's incredibly important for the long term health of Atom that we iterate our approach to theming and address the existing issues. It's a big project, but it's going to be great to get it started. |
That would be cool, but not sure about performance impact. Because if Anyways, I started with https://github.com/atom/atom-theme/blob/master/index.css. Let's see how often color functions are needed. |
But Less is a preprocessor right? So in that case we had to preprocess everything, whereas these custom transformation functions would compile down to calls to What I hadn't realized until looking at your link is that there's a built-in |
Ohh.. you mean it could be a custom function implemented with Houdini? Yeah, sounds like that will be possible one day. But my guess is that CSS color functions might be available before since there is already a spec for it?
Yeah, maybe for the most common colors, like the editor background, we could split it into :root {
--bg-h: 208;
--bg-s: 66%;
--bg-l: 99%;
--bg: hsl( var(--bg-h), var(--bg-s), var(--bg-l) ); /* default bg */
--my-bg: hsl( var(--bg-h), var(--bg-s), calc( var(--bg-l) - 20%) ); /* darken by 20% */
} Doing that for every color used in a theme might be overkill, but should be helpfull for the most common colors used. |
Basically I'm talking about a macro language that compiles down to stuff that would use standard features like variables and calc at the actual runtime. Your example is a great showcase of how it would work. Everything you wrote works today, but it's really verbose to write. So the preprocessing would just be designed to make it easier... So you could write something like I'm not saying this is necessarily a great idea, and could lead us down the road of maintaining non-standard stuff. But I just wanted to clarify what I'm trying to express. |
Wouldn't snippets be a better solution for the verbosity...? I have a CSS (and Less) snippet that expands |
Yeah, it's probably better to just eat the verbosity for the sake of just using standard features. The code you own ends up owning you. It was just an idea I wanted to put out there. |
Tried to simulate color functions in this test: https://codepen.io/simurai/pen/RxxzoG/?editors=0100. Kinda works, but still somewhat limiting, especially when trying to get enough contrast for the text labels. Another concern about the verbosity: It's not just having to type a lot, it's also reading and understand how it works. Theme/package authors might get too overwhelmed and would first have to read a blog post or the docs? So for the default theme, maybe just having simple hsl colors might be easiest to understand. Like: :root {
--fg: hsl(180, 20%, 80%);
--fg-strong: hsl(180, 50%, 99%);
--fg-subtle: hsl(180, 10%, 50%);
} Theme authors can always split it up more and use So far, the only time I needed separate hsl channels is for the |
Something neat: Have colors automatically adapt when inside a certain area. For example when a dock item moves to the center, it would use the colors for the center area (green in the example below): Theme authors would have to define some variables for each area, currently there are 3:
|
Adaptive colors are pretty dope. |
After testing
It's so bizarre. As if the spec relies on the atom-ui styles, but the styles from the package have no influence? 🤔 Anyways, maybe I'll leave the |
@simurai It looks like that's testing auto-scrolling to a tab when it's activated. Did you confirm that this actually breaks or is it just an issue with the test? It seems like we should be able to figure out how to get it working again. |
👍 I wanted this for a theme a while back but abandoned the idea because of the fragility of trying it with the current system. We still do contextual styling with the console but this would be nicer. |
Closing this. Too many themes/packages would break and should only be considered in a next major version. |
🐙 Project Mimicus
Question: Should Atom simplify theming?
👉 Rendered
Tests
when
, JS might can be used.Affected packages
atom/atom
👉 changesatom-ui
👉 changesatom-theme-temp
👉 changes (only used temporarily, use as UI theme)github
👉 changesatom-ide-ui
teletype
atom-select-list
atom-dark-syntax
atom-dark-ui
atom-light-syntax
atom-light-ui
base16-tomorrow-dark-theme
base16-tomorrow-light-theme
one-dark-ui
one-light-ui
one-dark-syntax
one-light-syntax
solarized-dark-syntax
solarized-light-syntax
about
archive-view
autocomplete-plus
background-tips
bookmarks
bracket-matcher
command-palette
deprecation-cop
exception-reporting
find-and-replace
fuzzy-finder
git-diff
image-view
👉 changesincompatible-packages
keybinding-resolver
markdown-preview
notifications
package-generator
settings-view
status-bar
👉 changesstyleguide
👉 changestabs
👉 changestimecop
tree-view
welcome
wrap-guide
Decision
TBD
Name inspiration: https://www.youtube.com/watch?v=os6HD-sCRn8