Skip to content

Commit

Permalink
Merge pull request #7 from beefchimi/cursor
Browse files Browse the repository at this point in the history
Add cursor
  • Loading branch information
beefchimi authored Oct 29, 2017
2 parents e43fdb0 + 307749f commit 4add7b0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions properties/_cursor.scss
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)}';
}
}
1 change: 1 addition & 0 deletions properties/properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@import 'border';
@import 'breakpoint';
@import 'color';
@import 'cursor';
@import 'duration';
@import 'easing';
@import 'font-stack';
Expand Down

0 comments on commit 4add7b0

Please sign in to comment.