From: Jackson Hamilton <jackson@jacksonrayhamilton.com>
To: 21898@debbugs.gnu.org
Subject: bug#21898: scss-mode font-lock face for variables
Date: Thu, 12 Nov 2015 22:37:57 -0800 [thread overview]
Message-ID: <CAGiE8AzNTaURW+BRtkqd-iVWwZDprJT9M7wphjJSFuZz6WAv5w@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 747 bytes --]
I'd like to propose the following change to the scss-mode on master: Use
font-lock-constant-face for SCSS variables.
This may not seem intuitive from a naming perspective, but
font-lock-variable-name-face is already used for CSS properties. That makes
it harder to distinguish between properties and variables.
AFAIK, Sass doesn't even have constants, so I don't see much harm in using
this face. It'd be a less dramatic change for those who have grown used to
variable coloring for CSS properties.
I guess the alternative would be to inherit the property face from
something else, to free up the face for real variables. But then what do we
use for properties? (Inheriting from nothing doesn't look good IMO.)
Attached is the proposed patch.
[-- Attachment #1.2: Type: text/html, Size: 885 bytes --]
[-- Attachment #2: 0001-Use-font-lock-constant-face-for-scss-variables.patch --]
[-- Type: text/x-patch, Size: 959 bytes --]
From 72fb4670228324b59531a19409618277b62ad230 Mon Sep 17 00:00:00 2001
From: Jackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Date: Thu, 12 Nov 2015 22:21:38 -0800
Subject: [PATCH] Use `font-lock-constant-face' for scss variables
* css-mode.el (scss-font-lock-keywords): Change face.
---
lisp/textmodes/css-mode.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 3e84b43..e35e6cb 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -525,7 +525,7 @@ pseudo-classes, and at-rules."
st))
(defvar scss-font-lock-keywords
- (append `((,(concat "$" css-ident-re) (0 font-lock-variable-name-face)))
+ (append `((,(concat "$" css-ident-re) (0 font-lock-constant-face)))
(css--font-lock-keywords 'sassy)
`((,(concat "@mixin[ \t]+\\(" css-ident-re "\\)[ \t]*(")
(1 font-lock-function-name-face)))))
--
2.6.3
next reply other threads:[~2015-11-13 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 6:37 Jackson Hamilton [this message]
2015-11-13 20:29 ` bug#21898: scss-mode font-lock face for variables Simen Heggestøyl
2017-07-29 16:46 ` Simen Heggestøyl
2017-07-29 17:24 ` Jackson Ray Hamilton
2017-07-30 9:33 ` Simen Heggestøyl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGiE8AzNTaURW+BRtkqd-iVWwZDprJT9M7wphjJSFuZz6WAv5w@mail.gmail.com \
--to=jackson@jacksonrayhamilton.com \
--cc=21898@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.