mirror of
https://github.com/danog/sass-site.git
synced 2024-12-12 17:37:36 +01:00
49c217e039
* main: review Porting Documentation - At-Rules - extend Porting Documentation - At-Rules - function Lint Porting Documentation - At-Rules - mixin
48 lines
817 B
Plaintext
48 lines
817 B
Plaintext
{% codeExample 'mixin-arbitrary-kwargs' %}
|
|
@use "sass:meta";
|
|
|
|
@mixin syntax-colors($args...) {
|
|
@debug meta.keywords($args);
|
|
// (string: #080, comment: #800, variable: #60b)
|
|
|
|
@each $name, $color in meta.keywords($args) {
|
|
pre span.stx-#{$name} {
|
|
color: $color;
|
|
}
|
|
}
|
|
}
|
|
|
|
@include syntax-colors(
|
|
$string: #080,
|
|
$comment: #800,
|
|
$variable: #60b,
|
|
)
|
|
===
|
|
@use "sass:meta"
|
|
|
|
@mixin syntax-colors($args...)
|
|
@debug meta.keywords($args)
|
|
// (string: #080, comment: #800, variable: #60b)
|
|
|
|
@each $name, $color in meta.keywords($args)
|
|
pre span.stx-#{$name}
|
|
color: $color
|
|
|
|
|
|
|
|
|
|
@include syntax-colors($string: #080, $comment: #800, $variable: #60b)
|
|
===
|
|
pre span.stx-string {
|
|
color: #080;
|
|
}
|
|
|
|
pre span.stx-comment {
|
|
color: #800;
|
|
}
|
|
|
|
pre span.stx-variable {
|
|
color: #60b;
|
|
}
|
|
{% endcodeExample %}
|