blob: 7cf178ca939dad83633273335732f39a944e1bfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'sass/common.rb'
class Scss < SassCommon
title "SCSS"
desc "SCSS stylesheets (sass-lang.com)"
tag 'scss'
filenames '*.scss'
mimetypes 'text/x-scss'
state :root do
rule %r/\s+/, Text
rule %r(//.*?$), Comment::Single
rule %r(/[*].*?[*]/)m, Comment::Multiline
rule %r/@import\b/, Keyword, :value
mixin :content_common
rule(/(?=[^;{}][;}])/) { push :attribute }
rule(/(?=[^;{}:\[]+:[^a-z])/) { push :attribute }
rule(//) { push :selector }
end
state :end_section do
rule %r/\n/, Text
rule(/[;{}]/) { token Punctuation; reset_stack }
end
end
end
end
|