Add pug (jade) support#67
Conversation
|
Would you mind creating the same change for https://github.com/atom/one-light-syntax? |
|
Of course. The PR is here: atom/one-light-syntax#17 |
|
@simurai what do you think? |
|
The styles seem fine. 👍 But not sure where we wanna draw the line what language should be supported in the default theme. Should it only be languages that come bundled by default with Atom? I guess every selector that gets added comes with a tiny tiny performance cost, even though you might never need those styles. Or is that so small that we shouldn't worry about it? /cc @atom/languages @atom/feedback |
|
I'm personally leaning towards only adding support for languages bundled with Atom. At the same time, I realize that might not provide an optimal end-user experience... |
|
Is it possible to add language support to a theme, via a separated package? That's what I searched for, before ending up with this PR. |
|
@webdif Yes, it is. For example, here is some code from my .theme-one-light-ui, .theme-one-dark-ui {
.status-bar { font-size: 15px; }
.tab-bar { font-size: 15px; }
.tree-view { font-size: 15px; }
}Atom adds the names of the themes as classes on On the flip side, a separate package isn't going to have access as easily to the color information you're using in this PR. |
|
In this case, you could hard code the colors in your .theme-one-dark-syntax atom-text-editor::shadow {
.source.pug,
.source.jade {
.meta {
&.tag.attribute {
&.id {
color: hsl(207, 82%, 66%);
}
&.class {
color: hsl( 29, 54%, 61%);
}
}
&.delimiter {
color: hsl( 5, 48%, 51%);
}
}
.constant.character.entity {
color: hsl( 39, 67%, 69%);
}
}
}Of course, the colors could change, unlikely anytime soon, but still. So another option is to try to use the official variables. Other themes might support them too and if not, there is a fallback from core: @import "syntax-variables";
atom-text-editor::shadow {
.source.pug,
.source.jade {
.meta {
&.tag.attribute {
&.id {
color: @syntax-color-method; // @hue-2
}
&.class {
color: @syntax-color-attribute; // @hue-6
}
}
&.delimiter {
color: @syntax-color-variable; // @hue-5-2
}
}
.constant.character.entity {
color: @syntax-color-class; // @hue-6-2
}
}
}But it might not always be easy to map the right variables. |
|
Options I can think of:
|
|
For now I would suggest doing option Then when Atom @webdif Are you ok customizing it in your |
|
I'm OK with this 👍 |
Before / after: