blob: e9b041eea64954f4bd0d80e9e70428fd5cbf4734 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
extends ../_layout/_docs-layout.pug
block variables
- var slug = 'tooltips'
- var parent = 'components'
- var title = 'Tooltips - Components - Spectre.css CSS Framework'
- var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
block docs-content
+docs-heading('tooltips', 'Tooltips')
include ../_layout/_ad-g.pug
p Tooltips provide context information labels that appear on hover and focus.
.docs-demo.columns.text-center
.column.col-xs-12
button.btn.btn-primary.tooltip(data-tooltip="Top Tooltip Text") top tooltip
.column.col-xs-12
button.btn.btn-primary.tooltip.tooltip-right(data-tooltip="Right Tooltip Text") right tooltip
.column.col-xs-12
button.btn.btn-primary.tooltip.tooltip-bottom(data-tooltip="Bottom Tooltip Text") bottom tooltip
.column.col-xs-12
button.btn.btn-primary.tooltip.tooltip-left(data-tooltip="Left Tooltip Text\nMultiline") left tooltip
p Tooltips component is built entirely in CSS.
p
| Add the #[code tooltip] class and the #[code data-tooltip] attribute, which contains the tooltip content, to non self closing elements.
p
| And add the #[code tooltip-right], #[code tooltip-bottom] or #[code tooltip-left] class to define the position of a tooltip.
| By default, the tooltip appears above the element.
pre.code(data-lang='HTML')
code
:highlight(lang="html")
<button class="btn tooltip" data-tooltip="Lorem ipsum dolor sit amet">top tooltip</button>
<button class="btn tooltip tooltip-right" data-tooltip="Lorem ipsum dolor sit amet">right tooltip</button>
+docs-subheading('tooltips-multiline', 'Multiline tooltips')
.docs-demo.columns
.column.col-12
button.btn.btn-primary.tooltip(data-tooltip="First Line Tooltip Text \n Second Line Tooltip Text \n Third Line Tooltip Text") multiline tooltip
p
| Add the #[code \n] string between any text for multiline tooltips.
pre.code(data-lang='HTML')
code
:highlight(lang="html")
<button class="btn tooltip" data-tooltip="First Line Tooltip Text \n Second Line Tooltip Text">multiline tooltip</button>
include ../_layout/_ad-c.pug
include ../_layout/_footer.pug
|