You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
The ThorDark theme we include in core is built in a way that relies on being able to load LESS copies of some of the core Brackets default styles, which are not actually present in minified builds.
I think the way ThorDarkTheme/main.less currently works is:
It redefines a bunch of the core LESS code's color variables
Earlier in the file, it uses @include to load a copy of the core LESS code.
LESS has a sort of "variable hoisting," so when the @include-ed core code earlier in the file is compiled to CSS, it uses the dark color values instead of the default values.
The result is two copies of many of core's CSS rules -- with all the properties identical except for the color values. When the dark theme is enabled, the dark versions of all the rules override the light versions (they both have higher specificity, due to the extra theme-name prefix that gets added by ThemeManager.lessifyTheme(), and also were loaded more recent which would give them precedence even if they had identical specificity).
If that is indeed how it works, it has several problems:
Won't work in minified builds, since the default core LESS files aren't present
Is very inefficient, since it results in redundant copies of many of core's CSS rules -- far fewer rules would be needed to just override the few CM colors that need overriding
Doesn't set a good example for extension themes to follow, for both of the above reasons
The ThorDark theme we include in core is built in a way that relies on being able to load LESS copies of some of the core Brackets default styles, which are not actually present in minified builds.
I think the way ThorDarkTheme/main.less currently works is:
@includeto load a copy of the core LESS code.@include-ed core code earlier in the file is compiled to CSS, it uses the dark color values instead of the default values.ThemeManager.lessifyTheme(), and also were loaded more recent which would give them precedence even if they had identical specificity).If that is indeed how it works, it has several problems: