-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from beefchimi/cursor
Add cursor
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//// | ||
/// Threads Properties | ||
/// Cursor | ||
//// | ||
|
||
$cursor-label: 'cursor'; | ||
|
||
$threads-properties: map-merge( | ||
$threads-properties, ( | ||
$cursor-label: () | ||
) | ||
); | ||
|
||
// Returns the url path and fallback value for the given group and variant. | ||
// @param {String} $group (optional) - The key for the cursor group. | ||
// @param {String} $variant (optional) - The key for the cursor variant. | ||
// @return {String} The url path to the image asset and the fallback value. | ||
@function cursor($group: $threads-default-value, $variant: $threads-default-value) { | ||
$cursor-data: map-get($threads-properties, $cursor-label); | ||
$fetched-cursor: threads-value-get($cursor-data, $group, $variant); | ||
|
||
@if type-of($fetched-cursor) == string or type-of($fetched-cursor) == list { | ||
@return $fetched-cursor; | ||
} @else { | ||
@error 'Cursor `#{$group} - #{$variant}` not found. Available options: #{available-names($cursor-data)}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters