• Stars
    star
    8,366
  • Rank 4,187 (Top 0.09 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A CSS only tooltip library for your lovely websites.

Hint.css npm version downloads/month Join the chat at https://gitter.im/chinchang/hint.css gzip size

A tooltip library in CSS for your lovely websites

DemoGet startedWho's using this?Browser supportFAQsContributingLicense

hint.css is written as a pure CSS resource using which you can create cool accessible tooltips for your web app. It does not rely on JavaScript but rather uses aria-label/data- attribute*, pseudo elements, content property and CSS3 transitions to create the tooltips. Also it uses BEM naming convention particularly for the modifiers.

Get Started

Get the library using one of the following ways:

  1. GitHub

Full build

Base build (Does not include color themes and fancy effects)

  1. Bower : bower install hint.css

  2. npm: npm install --save hint.css

  3. CDN: https://www.jsdelivr.com/package/npm/hint.css or https://cdnjs.com/libraries/hint.css

Now include the library in the HEAD tag of your page:

<link rel="stylesheet" href="hint.css" />

or

<link rel="stylesheet" href="hint.min.css" />

Now, all you need to do is give your element any position class and tooltip text using the aria-label attribute. Note, if you don't want to use aria-label attribute, you can also specify the tooltip text using the data-hint attribute, but its recommended to use aria-label in support of accessibility. Read more about aria-label.

Hello Sir, <span class="hint--bottom" aria-label="Thank you!">hover me.</span>

Use it with other available modifiers in various combinations. Available modifiers:

  • Colors - hint--error, hint--info, hint--warning, hint--success
  • Sizes - hint--small, hint--medium, hint--large
  • hint--always
  • hint--rounded
  • hint--no-animate
  • hint--bounce
  • hint--no-arrow

Upgrading from v1.x

If you are already using v1.x, you may need to tweak certain position classes because of the way tooltips are positioned in v2.

Changing the prefix for class names

Don't like BEM naming (hint--) or want to use your own prefix for the class names?

Simply update src/hint-variables.scss and change the $hintPrefix variable. To generate the css file, please read the contributing page.

Who's Using This?

Are you using hint.css in your awesome project too? Just tweet it out to @hint_css or let us know on the mailing list.

Browser Support

hint.css works on all latest browsers, though the transition effect is supported only on IE10+, Chrome 26+ and FF4+ at present.

  • Chrome - basic + transition effects
  • Firefox - basic + transition effects
  • Opera - basic
  • Safari - basic
  • IE 10+ - basic + transition effects
  • IE 8 & 9 - basic

FAQs

Checkout the FAQ Wiki for some common gotchas to be aware of while using hint.css.

Contributing

hint.css is developed in SASS and the source files can be found in the src/ directory.

If you would like to create more types of tooltips/ fix bugs/ enhance the library etc. you are more than welcome to submit your pull requests.

Read more on contributing.

Changelog & Updates

See the Changelog.

To catch all updates and discussion, join the mailing list: [email protected].

Or follow on twitter: @hint_css

License

Hint.css is free for personal and commercial use under the MIT License.

Credits

This doesn't make use of a lot of BEM methodology but big thanks to @csswizardry, @necolas for their awesome articles on BEM and to @joshnh through whose work I came to know about it :)

Sponsor

More Repositories

1

web-maker

A blazing fast & offline frontend playground
JavaScript
2,469
star
2

cta.js

Animate your 'action-to-effect' paths
JavaScript
1,652
star
3

superplaceholder.js

⚡Super charge your input placeholders
JavaScript
988
star
4

screenlog.js

Bring console.log on the screen
JavaScript
845
star
5

code-blast-codemirror

✨Particles blasts while typing in Codemirror
JavaScript
341
star
6

picssel-art

An app to create pixel art using only CSS
JavaScript
137
star
7

build-git-learn-git

What better way to learn Git than to implement one of your own!
136
star
8

simplezoom.js

A tiny JavaScript library to preview images, better way!
JavaScript
82
star
9

super-search

Easy to add search for your blog
JavaScript
77
star
10

vuejsfire-hackathon-starter

Hackathon starter kit based on vue.js and Firebase
Vue
71
star
11

IsoBlocks

A library to create eye-candy isometric texts.
JavaScript
54
star
12

you-dont-need-to-know-web-development

😓 You don't need to know Web Development!
29
star
13

lollipop.css

Android Lollipop animations in CSS
HTML
20
star
14

where-to-report

CSS
19
star
15

kalu

Calculation at speed
HTML
18
star
16

kushagra.dev

My personal site and blog
JavaScript
16
star
17

AS3-Motion-Tracker

A simple webcam based motion tracker written in Actionscript 3.0
ActionScript
14
star
18

konsole.table

console.table polyfill for Node.js
JavaScript
13
star
19

Bouncy_HTML5

HTML5 version of my game Bouncy.
JavaScript
12
star
20

web-vim

Vim like text based editor for prototyping web pages with speed!
HTML
11
star
21

awesome-google-sheet

Super useful google sheets for just about anything! ⭐️
9
star
22

introduction-to-accessibility

Interactive and practical introduction to Web Accessibility for everyone
JavaScript
8
star
23

loremizer

lorem ipsum-izes any web page
JavaScript
8
star
24

a11y-for-managers

Translate Accessibility issues on a website into actual understandable feedback from dummy users.
JavaScript
8
star
25

ask-me-anything

Ask me anything
7
star
26

ggj13

HTML5 game where you see only when your heart beats!
JavaScript
6
star
27

LD23

My Ludum Dare 23 entry.
ActionScript
5
star
28

Copter

A simple copter game clone
4
star
29

Defenders-From-Past

An HTML5 game made for BYOG, April 2012
JavaScript
4
star
30

vuejs-html5mode

POC for HTML5 mode work without server-side code
JavaScript
4
star
31

js13k-2018-key-battle

My game entry for js13kgames compo 2018
CSS
3
star
32

editur

My own sweet live web editor
JavaScript
3
star
33

cssconf-asia

My slides and game source for CSSConf.Asia '14
JavaScript
2
star
34

dotfiles

My super-duper dotfiles
Shell
2
star
35

let-me-read

A chrome extension for distraction free reading.
JavaScript
2
star
36

JIDE

JIDE is an IDE for Java language written in C++ and wxWidgets.
C++
2
star
37

MMORPC-Framework

This is basically a WIP of a MMORPC ('C' stands for 'chat' here) application I am developing. It uses Node.js for the server end and Actionscript 3.0 (flash) for the client side.
2
star
38

js13k-2017-the-lost-pixel

My game entry for js13kgames compo 2017
HTML
1
star
39

js13k-2013-world-is-falling

Multiplayer game entry for jsk13 compo
JavaScript
1
star
40

pacman-html5

JavaScript
1
star
41

webdev-samachar

HTML
1
star
42

js13k-2016-remember

My entry for JS13kGames compo. Made using CSS 3D!
CSS
1
star