Skip to content

Commit

Permalink
feat(Utilities): support ns-resized cursor type
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincharity committed Oct 25, 2019
1 parent b48f194 commit 6509194
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
27 changes: 15 additions & 12 deletions terminus-ui/scss/docs/cursors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Cursors](#cursors)
- [Cursor](#cursor)
- [Available cursor values](#available-cursor-values)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Cursors
## Cursor

The `cursor()` function returns the correct cursor value based on the desired type.

Expand Down Expand Up @@ -36,15 +36,18 @@ This is also available as a mixin:
> These values are currently basically 1-to-1 with the actual CSS values. We expect this to change
> over time as we create usage-driven names.
| Value | Meaning |
|---------------|-----------------------------------------|
| `alias` | Indicates an alias or copy will be made |
| `auto` | Let the browser decide |
| `col-resize` | Indicates the ability to resize |
| `copy` | Indicates ability to copy |
| `help` | Indicates help is available |
| `not-allowed` | Indicates no available interaction |
| `pointer` | Indicates interaction |
| `text` | Indicates text controls |
| Value | Meaning |
|---------------|------------------------------------------|
| `alias` | Indicates an alias or copy will be made |
| `auto` | Let the browser decide |
| `col-resize` | Indicates the ability to resize |
| `copy` | Indicates ability to copy |
| `default` | The default browser cursor |
| `help` | Indicates help is available |
| `move` | Indicates the ability to move an item |
| `not-allowed` | Indicates no available interaction |
| `ns-resized` | Indicates the ability to move vertically |
| `pointer` | Indicates interaction |
| `text` | Indicates text controls |

Passing an invalid cursor `$type` will throw a Sass compilation error.
2 changes: 2 additions & 0 deletions terminus-ui/scss/helpers/_cursors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ $g-cursors: (
move,
/* Indicates no available interaction */
not-allowed,
/* Indicates the ability to move North and South */
ns-resize,
/* Indicates interaction */
pointer,
/* Indicates text controls */
Expand Down
24 changes: 24 additions & 0 deletions terminus-ui/scss/helpers/_cursors.spec.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
@import 'true';
@import './cursors';


@include describe ('cursors') {
@include test ('should output a cursor') {
@include assert {
@include output {
.foo {
cursor: cursor(col-resize);
}
.bar {
cursor: cursor(help);
}
}
@include expect {
.foo {
cursor: col-resize;
}
.bar {
cursor: help;
}
}
}
}
}

0 comments on commit 6509194

Please sign in to comment.