2018-10-25 00:01:43 +02:00
|
|
|
<%# TODO(nweiz): auto-generate this CSS once we're compiling with Dart Sass %>
|
|
|
|
|
|
|
|
<% example do %>
|
2019-09-03 01:32:14 +02:00
|
|
|
@use "sass:list";
|
|
|
|
@use "sass:meta";
|
|
|
|
@use "sass:string";
|
|
|
|
|
2018-10-25 00:01:43 +02:00
|
|
|
/// Return a copy of $list with all elements for which $condition returns `true`
|
|
|
|
/// removed.
|
|
|
|
@function remove-where($list, $condition) {
|
|
|
|
$new-list: ();
|
2019-09-03 01:32:14 +02:00
|
|
|
$separator: list.separator($list);
|
2018-10-25 00:01:43 +02:00
|
|
|
@each $element in $list {
|
2019-09-03 01:32:14 +02:00
|
|
|
@if not meta.call($condition, $element) {
|
|
|
|
$new-list: list.append($new-list, $element, $separator: $separator);
|
2018-10-25 00:01:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@return $new-list;
|
|
|
|
}
|
|
|
|
|
|
|
|
$fonts: Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
|
|
|
|
|
|
content {
|
|
|
|
@function contains-helvetica($string) {
|
2019-09-03 01:32:14 +02:00
|
|
|
@return string.index($string, "Helvetica");
|
2018-10-25 00:01:43 +02:00
|
|
|
}
|
2019-09-03 01:32:14 +02:00
|
|
|
font-family: remove-where($fonts, meta.get-function("contains-helvetica"));
|
2018-10-25 00:01:43 +02:00
|
|
|
}
|
|
|
|
===
|
2019-09-03 01:32:14 +02:00
|
|
|
@use "sass:list"
|
|
|
|
@use "sass:meta"
|
|
|
|
@use "sass:string"
|
|
|
|
|
2018-10-25 00:01:43 +02:00
|
|
|
/// Return a copy of $list with all elements for which $condition returns `true`
|
|
|
|
/// removed.
|
|
|
|
@function remove-where($list, $condition)
|
|
|
|
$new-list: ()
|
2019-09-03 01:32:14 +02:00
|
|
|
$separator: list.separator($list)
|
2018-10-25 00:01:43 +02:00
|
|
|
@each $element in $list
|
2019-09-03 01:32:14 +02:00
|
|
|
@if not meta.call($condition, $element)
|
|
|
|
$new-list: list.append($new-list, $element, $separator: $separator)
|
2018-10-25 00:01:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
@return $new-list
|
|
|
|
|
|
|
|
|
|
|
|
$fonts: Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif
|
|
|
|
|
|
|
|
content
|
|
|
|
@function contains-helvetica($string)
|
2019-09-03 01:32:14 +02:00
|
|
|
@return string.index($string, "Helvetica")
|
2018-10-25 00:01:43 +02:00
|
|
|
|
2019-09-03 01:32:14 +02:00
|
|
|
font-family: remove-where($fonts, meta.get-function("contains-helvetica"))
|
2018-10-25 00:01:43 +02:00
|
|
|
===
|
|
|
|
content {
|
|
|
|
font-family: Tahoma, Geneva, Arial, sans-serif;
|
|
|
|
}
|
|
|
|
<% end %>
|