Skip to content

Commit

Permalink
refactor(object.use()): assign value.
Browse files Browse the repository at this point in the history
  • Loading branch information
sciborrudnicki committed Sep 11, 2023
1 parent fc324ed commit 83835d9
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions object/_object.use.function.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
// Sass.
@use 'sass:map';

// Object.
// Variables.
@use 'object.var' as object;

// Status: DONE
// The `object.use()` function select object on which object functions, by default operates.
// @param `$name` Name of the object, if it's `null` indicates to not use any object.
// @returns The returned value is `$name` if object was created, otherwise `null`.
@function use($name) {
@if $name {
@if object.$name == $name {
@return $name;
} @else if map.has-key(object.$object, $name) {
object.$name: $name;
@return object.$name;
}
} @else {
object.$name: null;
}
@return null;
object.$name: $name;
@return object.$name;
}

0 comments on commit 83835d9

Please sign in to comment.