Open core-ai-bot opened 3 years ago
Comment by swmitra Friday Aug 11, 2017 at 10:45 GMT
@
ficristo Thanks a lot for pointing it out 👍. I needed this for JavaScript specific code coloring but missed the 'addModeClass' option completely. Closing this PR, I will enable the option in theme config json.
Issue by swmitra Friday Aug 11, 2017 at 09:08 GMT Originally opened as https://github.com/adobe/brackets/pull/13607
This will enable theme developers and contributors to design code themes for a particular doc mode by using descendant selectors. For example consider the following HTML snippet -
And the following CSS snippet -
In both HTML and CSS doc modes 'div' has been assigned '.cm-tag' selector. This implies that if in this LESS file the selector group containing '.cm-tag' is assigned a color value '#446fbd', the tag name 'div' in HTML and the selector name 'div' in CSS will have the same color.
However it's possible to specify different color values for these selectors targetting different language modes. What needs to be done is identify the tokens what's being used in a particular doc mode and target the corresponding selectors by nesting them under the MODE selector.
For example let's take the snippets and case described above. If we want to override the default color of tag only in HTML mode, we need to append this selector after the "custom" marker in this LESS file.
This example can be expanded to include individual selectors or certain selectors grouped together.
These are the list of popular language modes along with the file extensions which they are associated with. Any of these modes can be used as parent selectors and then the individual token color can be nested inside to make sure that we change only the targetted modes coloring.
swmitra included the following code: https://github.com/adobe/brackets/pull/13607/commits