mirror of
https://github.com/danog/sass-site.git
synced 2024-11-27 04:24:50 +01:00
232a020b1a
* Fix code examples in map and meta modules.
59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
<%# TODO(nweiz): auto-generate this CSS once we're compiling with Dart Sass %>
|
|
|
|
<% example do %>
|
|
@use "sass:list";
|
|
@use "sass:meta";
|
|
@use "sass:string";
|
|
|
|
/// Return a copy of $list with all elements for which $condition returns `true`
|
|
/// removed.
|
|
@function remove-where($list, $condition) {
|
|
$new-list: ();
|
|
$separator: list.separator($list);
|
|
@each $element in $list {
|
|
@if not meta.call($condition, $element) {
|
|
$new-list: list.append($new-list, $element, $separator: $separator);
|
|
}
|
|
}
|
|
@return $new-list;
|
|
}
|
|
|
|
$fonts: Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
|
|
content {
|
|
@function contains-helvetica($string) {
|
|
@return string.index($string, "Helvetica");
|
|
}
|
|
font-family: remove-where($fonts, meta.get-function("contains-helvetica"));
|
|
}
|
|
===
|
|
@use "sass:list"
|
|
@use "sass:meta"
|
|
@use "sass:string"
|
|
|
|
/// Return a copy of $list with all elements for which $condition returns `true`
|
|
/// removed.
|
|
@function remove-where($list, $condition)
|
|
$new-list: ()
|
|
$separator: list.separator($list)
|
|
@each $element in $list
|
|
@if not meta.call($condition, $element)
|
|
$new-list: list.append($new-list, $element, $separator: $separator)
|
|
|
|
|
|
@return $new-list
|
|
|
|
|
|
$fonts: Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif
|
|
|
|
.content
|
|
@function contains-helvetica($string)
|
|
@return string.index($string, "Helvetica")
|
|
|
|
font-family: remove-where($fonts, meta.get-function("contains-helvetica"))
|
|
===
|
|
.content {
|
|
font-family: Tahoma, Geneva, Arial, sans-serif;
|
|
}
|
|
<% end %>
|