Skip to content

Commit

Permalink
feat(style): add cursor class utilities (#17033)
Browse files Browse the repository at this point in the history
Co-authored-by: John Leider <[email protected]>
  • Loading branch information
santiagoaloi and johnleider authored Jan 18, 2024
1 parent d121f54 commit a25aac9
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/docs/src/data/nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
},
"border-radius",
"content",
"cursor",
"display",
"elevation",
"flex",
Expand Down
51 changes: 51 additions & 0 deletions packages/docs/src/examples/cursor/usage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template>
<v-container>
<v-row justify="space-between">
<v-col v-for="cursor in cursors" :key="cursor" cols="3">
<v-btn
:text="cursor"
:class="`cursor-${cursor}`"
block
></v-btn>
</v-col>
</v-row>
</v-container>
</template>

<script setup>
const cursors = [
'auto',
'default',
'grab',
'grabbing',
'help',
'move',
'none',
'not-allowed',
'pointer',
'progress',
'text',
'wait',
]
</script>

<script>
export default {
data: () => ({
cursors: [
'auto',
'default',
'grab',
'grabbing',
'help',
'move',
'none',
'not-allowed',
'pointer',
'progress',
'text',
'wait',
],
}),
}
</script>
52 changes: 52 additions & 0 deletions packages/docs/src/pages/en/styles/cursor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
emphasized: true
meta:
title: Cursor
description: Assign a custom cursor to any element.
keywords: cursor, utility, helper, class
related:
- /styles/content/
- /styles/spacing/
- /styles/text-and-typography/
---

# Cursor

Utilities for controlling the cursor styling when hovering over elements.

<page-features />

## Usage

Apply custom cursor styling to a component or element.

<example file="cursor/usage" />

| Class | Properties | |
| - | - | - |
| **cursor-auto** | cursor: auto; | |
| **cursor-default** | cursor: default; | |
| **cursor-grab** | cursor: grab; | |
| **cursor-grabbing** | cursor: grabbing; | |
| **cursor-help** | cursor: help; | |
| **cursor-move** | cursor: move; | |
| **cursor-none** | cursor: none; | |
| **cursor-not-allowed** | cursor: not-allowed; | |
| **cursor-pointer** | cursor: pointer; | |
| **cursor-progress** | cursor: progress; | |
| **cursor-text** | cursor: text; | |
| **cursor-wait** | cursor: wait; | |

<entry />

## Disable

Disable the generation of **cursor** utility classes by overwriting the utilities value:

```scss { resource="src/styles/settings.scss" }
@use 'vuetify/settings' with (
$utilities: (
"cursor": false,
),
);
```
6 changes: 6 additions & 0 deletions packages/vuetify/src/styles/settings/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ $utilities: () !default;
class: position,
values: static relative fixed absolute sticky
),
// Cursor
"cursor": (
property: cursor,
class: cursor,
values: auto default pointer wait text move help not-allowed progress grab grabbing none
),
// Sizing
"fill-height": (
property: height,
Expand Down

0 comments on commit a25aac9

Please sign in to comment.