GithubHelp home page GithubHelp logo

rlugojr / hint.css Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chinchang/hint.css

0.0 2.0 0.0 204 KB

A tooltip library in CSS for your lovely websites.

Home Page: http://kushagragour.in/lab/hint/

License: Other

JavaScript 4.04% HTML 21.16% CSS 74.81%

hint.css's Introduction

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

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: http://www.jsdelivr.com/#!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"></link>

or

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

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

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

Commercial License

If you want to use Hint.css for business, commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Purchase a Hint.css Commercial License at https://kushagragour.in/lab/hint/#commercial

Open-source License

Hint.css is free for personal use under the GNU AGPLv3.

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 :)

hint.css's People

Contributors

chinchang avatar prayagverma avatar rlugojr avatar cupoftea696 avatar nathggns avatar basarat avatar bitdeli-chef avatar th3fallen avatar ndmitry avatar evanhahn avatar nixme avatar jamiebuilds avatar jdan avatar paazmaya avatar kathgironpe avatar marcobiedermann avatar marklemerise avatar moox avatar ryanve avatar s12chung avatar shadowhand avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.