summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/coderay/scanners/css.rb4
-rw-r--r--lib/coderay/scanners/sass.rb6
-rw-r--r--lib/coderay/styles/alpha.rb1
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/coderay/scanners/css.rb b/lib/coderay/scanners/css.rb
index 22c6bfc..732f9c5 100644
--- a/lib/coderay/scanners/css.rb
+++ b/lib/coderay/scanners/css.rb
@@ -10,7 +10,7 @@ module Scanners
:class, :pseudo_class, :tag,
:id, :directive,
:key, :value, :operator, :color, :float, :string,
- :error, :important,
+ :error, :important, :type,
] # :nodoc:
module RE # :nodoc:
@@ -99,7 +99,7 @@ module Scanners
when :media_before_name
if match = scan(RE::Ident)
- encoder.text_token match, :tag
+ encoder.text_token match, :type
states[-1] = :media_after_name
next
end
diff --git a/lib/coderay/scanners/sass.rb b/lib/coderay/scanners/sass.rb
index 0eb2caa..218ee57 100644
--- a/lib/coderay/scanners/sass.rb
+++ b/lib/coderay/scanners/sass.rb
@@ -38,16 +38,16 @@ module Scanners
elsif case states.last
when :initial, :media, :sass_inline
if match = scan(/(?>#{RE::Ident})(?!\()/ox)
- encoder.text_token match, value_expected ? :value : (check(/.*:/) ? :key : :type)
+ encoder.text_token match, value_expected ? :value : (check(/.*:/) ? :key : :tag)
next
elsif !value_expected && (match = scan(/\*/))
- encoder.text_token match, :type
+ encoder.text_token match, :tag
next
elsif match = scan(RE::Class)
encoder.text_token match, :class
next
elsif match = scan(RE::Id)
- encoder.text_token match, :constant
+ encoder.text_token match, :id
next
elsif match = scan(RE::PseudoClass)
encoder.text_token match, :pseudo_class
diff --git a/lib/coderay/styles/alpha.rb b/lib/coderay/styles/alpha.rb
index 81bbe3b..a21fbf1 100644
--- a/lib/coderay/styles/alpha.rb
+++ b/lib/coderay/styles/alpha.rb
@@ -84,6 +84,7 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; }
.function .delimiter { color:#024; font-weight:bold }
.global-variable { color:#d70 }
.hex { color:#02b }
+.id { color:#33D; font-weight:bold }
.imaginary { color:#f00 }
.include { color:#B44; font-weight:bold }
.inline { background-color: hsla(0,0%,0%,0.07); color: black }