2018-10-23 22:01:12 +02:00
|
|
|
<% example do %>
|
2019-09-11 01:31:02 +02:00
|
|
|
@use "sass:meta";
|
2019-09-03 01:32:14 +02:00
|
|
|
|
2018-10-23 22:42:40 +02:00
|
|
|
@mixin syntax-colors($args...) {
|
2019-09-11 01:31:02 +02:00
|
|
|
@debug meta.keywords($args);
|
2020-10-07 23:36:29 +02:00
|
|
|
// (string: #080, comment: #800, variable: #60b)
|
2018-10-23 22:01:12 +02:00
|
|
|
|
2019-09-11 01:31:02 +02:00
|
|
|
@each $name, $color in meta.keywords($args) {
|
2018-10-23 22:42:40 +02:00
|
|
|
pre span.stx-#{$name} {
|
|
|
|
color: $color;
|
|
|
|
}
|
2018-10-23 22:01:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-23 22:42:40 +02:00
|
|
|
@include syntax-colors(
|
|
|
|
$string: #080,
|
|
|
|
$comment: #800,
|
|
|
|
$variable: #60b,
|
|
|
|
)
|
|
|
|
===
|
2019-09-11 01:31:02 +02:00
|
|
|
@use "sass:meta"
|
2019-09-03 01:32:14 +02:00
|
|
|
|
2018-10-23 22:42:40 +02:00
|
|
|
@mixin syntax-colors($args...)
|
2019-09-11 01:31:02 +02:00
|
|
|
@debug meta.keywords($args)
|
2020-10-07 23:36:29 +02:00
|
|
|
// (string: #080, comment: #800, variable: #60b)
|
2018-10-23 22:01:12 +02:00
|
|
|
|
2019-09-11 01:31:02 +02:00
|
|
|
@each $name, $color in meta.keywords($args)
|
2018-10-23 22:42:40 +02:00
|
|
|
pre span.stx-#{$name}
|
|
|
|
color: $color
|
2018-10-23 22:01:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-03 01:32:14 +02:00
|
|
|
@include syntax-colors($string: #080, $comment: #800, $variable: #60b)
|
2018-10-23 22:42:40 +02:00
|
|
|
===
|
|
|
|
pre span.stx-string {
|
|
|
|
color: #080;
|
|
|
|
}
|
2018-10-23 22:01:12 +02:00
|
|
|
|
2018-10-23 22:42:40 +02:00
|
|
|
pre span.stx-comment {
|
|
|
|
color: #800;
|
|
|
|
}
|
2018-10-23 22:01:12 +02:00
|
|
|
|
2018-10-23 22:42:40 +02:00
|
|
|
pre span.stx-variable {
|
|
|
|
color: #60b;
|
|
|
|
}
|
2018-10-23 22:01:12 +02:00
|
|
|
<% end %>
|