Project

hint

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Hint.css is a tooltip library written in SASS which uses only HTML/CSS to create simple tooltips.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0.12.2
>= 0

Runtime

>= 3.2.0
 Project Readme

Hint

This is gem-bundled version of Hint.css, ready to use with Rails or Compass.

Hint.css is a tooltip library written in SASS which uses only HTML/CSS to create simple tooltips. It does not rely on JavaScript and rather uses data-* attribute, pseudo elements, content property and CSS3 transitions to create the tooltips. Also it uses BEM naming convention particularly for the modifiers.

Installation

Add this line to your application's Gemfile:

gem 'hint'

Or install it yourself as:

$ gem install hint

Rails

Import hint in an SCSS file:

@import "hint";

or require it via Sprockets:

/*
 *= require hint
 */

Compass

Create new project:

$ compass create <project name> -r hint -u hint

or update an existing:

# In config.rb
require "hint"

Usage

Any element on your page which needs to have a tooltip has to be given at least one of the position classes: hint--top, hint--bottom, hint--left, hint--right to position the tooltip.

Hello Sir, <span class="hint--bottom">hover me.</span>

The tooltip text needs to be given using the data-hint attribute on that element.

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

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

  • hint--error
  • hint--info
  • hint--warning
  • hint--success
  • hint--always
  • hint--rounded

Check out some examples at http://kushagragour.in/lab/hint/

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request