diff options
| author | Stefan Monnier | 2014-10-20 12:36:34 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-10-20 12:36:34 -0400 |
| commit | bc0e9e47b645ecd8da86eb8ae5810ebf2fd62b97 (patch) | |
| tree | cd9aff1fe18c0593b94e03523debeb124685ffd3 /test/indent | |
| parent | 57fe1632f0dc40042dfb6593f81f451165987637 (diff) | |
| download | emacs-bc0e9e47b645ecd8da86eb8ae5810ebf2fd62b97.tar.gz emacs-bc0e9e47b645ecd8da86eb8ae5810ebf2fd62b97.zip | |
* lisp/textmodes/css-mode.el (scss-mode): New major-mode.
(css-mode-syntax-table): Use d style comment, to ease the scss case.
(css-ident-re): Allow things like @-moz-keyframes.
(scss--hash-re): New const.
(css--font-lock-keywords): New function, extracted from
css-font-lock-keywords.
(css-font-lock-keywords): Use it.
(scss-mode-syntax-table, scss-font-lock-keywords): New vars.
(scss-smie--not-interpolation-p): New function.
(css-smie--forward-token, css-smie--backward-token): Use it.
(css-mode): Remove left-over code.
* test/indent/scss-mode.scss: New file.
* test/indent/css-mode.css: Add a few uneventful examples.
Diffstat (limited to 'test/indent')
| -rw-r--r-- | test/indent/css-mode.css | 10 | ||||
| -rw-r--r-- | test/indent/scss-mode.scss | 57 |
2 files changed, 67 insertions, 0 deletions
diff --git a/test/indent/css-mode.css b/test/indent/css-mode.css index 4dbab06975c..564ac16f954 100644 --- a/test/indent/css-mode.css +++ b/test/indent/css-mode.css | |||
| @@ -1,7 +1,17 @@ | |||
| 1 | /* asdfasdf */ | ||
| 2 | |||
| 1 | .xxx | 3 | .xxx |
| 2 | { | 4 | { |
| 3 | } | 5 | } |
| 4 | 6 | ||
| 7 | article[role="main"] { | ||
| 8 | width: 60%; | ||
| 9 | } | ||
| 10 | |||
| 11 | /* asdfasdf */ | ||
| 12 | @foo x2 { | ||
| 13 | bla:toto; | ||
| 14 | } | ||
| 5 | .x2 | 15 | .x2 |
| 6 | { | 16 | { |
| 7 | foo: bar; | 17 | foo: bar; |
diff --git a/test/indent/scss-mode.scss b/test/indent/scss-mode.scss new file mode 100644 index 00000000000..7a29929efca --- /dev/null +++ b/test/indent/scss-mode.scss | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | // Comment! | ||
| 2 | |||
| 3 | nav { | ||
| 4 | ul { | ||
| 5 | margin: 0; /* More comment */ | ||
| 6 | padding: 0; | ||
| 7 | list-style: none; | ||
| 8 | } | ||
| 9 | |||
| 10 | li { display: inline-block; } | ||
| 11 | |||
| 12 | a { | ||
| 13 | display: block; | ||
| 14 | padding: 6px 12px; | ||
| 15 | text-decoration: none; | ||
| 16 | } | ||
| 17 | } | ||
| 18 | nav ul { | ||
| 19 | margin: 0; | ||
| 20 | padding: 0; | ||
| 21 | list-style: none; | ||
| 22 | } | ||
| 23 | |||
| 24 | nav li { | ||
| 25 | display: inline-block; | ||
| 26 | } | ||
| 27 | |||
| 28 | nav a var | ||
| 29 | { | ||
| 30 | display: block; | ||
| 31 | padding: 6px 12px; | ||
| 32 | text-decoration: none; | ||
| 33 | } | ||
| 34 | |||
| 35 | $name: foo; | ||
| 36 | $attr: border; | ||
| 37 | p.#{$name} var | ||
| 38 | { | ||
| 39 | x#{$attr}-color: blue; | ||
| 40 | } | ||
| 41 | article[role="main"] { | ||
| 42 | $toto: 500 !global; | ||
| 43 | float: left; | ||
| 44 | width: 600px / 888px * 100%; | ||
| 45 | height: 100px / 888px * 100%; | ||
| 46 | } | ||
| 47 | |||
| 48 | @import 'reset'; | ||
| 49 | |||
| 50 | @mixin border-radius($radius) { | ||
| 51 | -webkit-border-radius: $radius; | ||
| 52 | -moz-border-radius: $radius; | ||
| 53 | -ms-border-radius: $radius; | ||
| 54 | border-radius: $radius; | ||
| 55 | } | ||
| 56 | |||
| 57 | .box { @include border-radius(10px); } | ||