From 8beec1d67567243c68bdf4d78e7122d943ce1add Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 29 Aug 2015 17:14:40 +0200 Subject: [PATCH] refactor: less and bullet - use `&` instead of repeat `.markup` - fix font smoothing --- styles/asciidoc.atom-text-editor.less | 78 ++++++++++++++------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/styles/asciidoc.atom-text-editor.less b/styles/asciidoc.atom-text-editor.less index 6c31d1b..aeb7e0d 100644 --- a/styles/asciidoc.atom-text-editor.less +++ b/styles/asciidoc.atom-text-editor.less @@ -5,55 +5,61 @@ atom-text-editor, :host { .asciidoc { - .markup.bold { - font-weight: bold; - } + .markup{ + -webkit-font-smoothing: auto; - .markup.italic { - font-style: italic; - } + &.bold { + font-weight: bold; + } - .markup.url { - color: mix(red, @syntax-text-color, 20%); - } + &.italic { + font-style: italic; + } - .markup.htmlentity { - font-style: italic; - color: mix(red, @syntax-text-color, 20%); - } + &.url { + color: mix(red, @syntax-text-color, 20%); + } - .markup.biblioref, - .markup.blockid { - font-weight: bold; - color: mix(green, @syntax-text-color, 20%); - } + &.htmlentity { + font-style: italic; + color: mix(red, @syntax-text-color, 20%); + } - .markup.reference { - font-style: italic; - color: mix(green, @syntax-text-color, 20%); - } + &.biblioref, + &.blockid { + font-weight: bold; + color: mix(green, @syntax-text-color, 20%); + } + + &.reference { + font-style: italic; + color: mix(green, @syntax-text-color, 20%); + } + + &.admonition, + &.explicit, + &.heading, + &.section { + font-weight: bold; - .markup.admonition, - .markup.explicit, - .markup.heading, - .markup.section { - font-weight: bold; + // Lighten headers for dark themes. + & when (lightness(@syntax-background-color) < 50%){ + color: lighten(@syntax-text-color, 20%); + } - // Lighten headers for dark themes. - & when (lightness(@syntax-background-color) < 50%){ - color: lighten(@syntax-text-color, 20%); + // Darken headers for light themes. + & when (lightness(@syntax-background-color) > 50%){ + color: darken(@syntax-text-color, 20%); + } } - // Darken headers for light themes. - & when (lightness(@syntax-background-color) > 50%){ - color: darken(@syntax-text-color, 20%); + &.heading.blocktitle, + &.substitution{ + color: @syntax-text-color-unobtrusive; } } .block, - .markup.heading.blocktitle, - .markup.list.bullet, - .markup.substitution, .table.spec { color: @syntax-text-color-unobtrusive; }