diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:56:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:56:52 +0000 |
commit | 087bd1b14d5e1f45f60b1ffa64ca318c23b7c6ea (patch) | |
tree | d4139abfdd8c50b4b0ac84d876808a2f525dc958 /debian/missing-sources/bourbon-neat/app/assets/stylesheets/grid/_omega.scss | |
parent | Adding upstream version 2.0.0+dfsg. (diff) | |
download | sphinx-rtd-theme-087bd1b14d5e1f45f60b1ffa64ca318c23b7c6ea.tar.xz sphinx-rtd-theme-087bd1b14d5e1f45f60b1ffa64ca318c23b7c6ea.zip |
Adding debian version 2.0.0+dfsg-1.debian/2.0.0+dfsg-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/missing-sources/bourbon-neat/app/assets/stylesheets/grid/_omega.scss | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/debian/missing-sources/bourbon-neat/app/assets/stylesheets/grid/_omega.scss b/debian/missing-sources/bourbon-neat/app/assets/stylesheets/grid/_omega.scss new file mode 100644 index 0000000..532db05 --- /dev/null +++ b/debian/missing-sources/bourbon-neat/app/assets/stylesheets/grid/_omega.scss @@ -0,0 +1,112 @@ +@charset "UTF-8"; + +/// Removes the element's gutter margin, regardless of its position in the grid hierarchy or display property. It can target a specific element, or every `nth-child` occurrence. Works only with `block` layouts. +/// +/// @param {List} $query [block] +/// List of arguments. Supported arguments are `nth-child` selectors (targets a specific pseudo element) and `auto` (targets `last-child`). +/// +/// When passed an `nth-child` argument of type `*n` with `block` display, the omega mixin automatically adds a clear to the `*n+1` th element. Note that composite arguments such as `2n+1` do not support this feature. +/// +/// **Deprecation warning**: The omega mixin will no longer take a `$direction` argument. To change the layout direction, use `row($direction)` or set `$default-layout-direction` instead. +/// +/// @example scss - Usage +/// .element { +/// @include omega; +/// } +/// +/// .nth-element { +/// @include omega(4n); +/// } +/// +/// @example css - CSS Output +/// .element { +/// margin-right: 0; +/// } +/// +/// .nth-element:nth-child(4n) { +/// margin-right: 0; +/// } +/// +/// .nth-element:nth-child(4n+1) { +/// clear: left; +/// } + +@mixin omega($query: block, $direction: default) { + $table: belongs-to(table, $query); + $auto: belongs-to(auto, $query); + + @if $direction != default { + @include -neat-warn("The omega mixin will no longer take a $direction argument. To change the layout direction, use the direction(){...} mixin."); + } @else { + $direction: get-direction($layout-direction, $default-layout-direction); + } + + @if $table { + @include -neat-warn("The omega mixin no longer removes padding in table layouts."); + } + + @if length($query) == 1 { + @if $auto { + &:last-child { + margin-#{$direction}: 0; + } + } + + @else if contains-display-value($query) and $table == false { + margin-#{$direction}: 0; + } + + @else { + @include nth-child($query, $direction); + } + } @else if length($query) == 2 { + @if $auto { + &:last-child { + margin-#{$direction}: 0; + } + } @else { + @include nth-child(nth($query, 1), $direction); + } + } @else { + @include -neat-warn("Too many arguments passed to the omega() mixin."); + } +} + +@mixin nth-child($query, $direction) { + $opposite-direction: get-opposite-direction($direction); + + &:nth-child(#{$query}) { + margin-#{$direction}: 0; + } + + @if type-of($query) == string { + $query: str-replace($query, " ", ""); + $operator: false; + + @if str_index($query, "+") { + $operator: "+"; + } @else if str_index($query, "-") { + $operator: "-"; + } + + @if $operator { + $operator-index: str_index($query, $operator); + $first: str-slice($query, 0, ($operator-index - 1)); + $last: to-number(str-slice($query, ($operator-index + 1), -1)); + @if $operator == "+" { + $last: $last + 1; + } @else if $operator == "-" { + $last: $last - 1; + } + $nth: "#{$first}#{$operator}#{$last}"; + + &:nth-child(#{$nth}) { + clear: $opposite-direction; + } + } + } @else if type-of($query) == number and unit($query) == "n" { + &:nth-child(#{$query}+1) { + clear: $opposite-direction; + } + } +} |