Git Product home page Git Product logo

scss-tooltips's Introduction

SCSS Tooltips

A Sass / SCSS mixin for tooltips. Pure CSS, no extra HTML elements, and no Javascript required.

Documentation and examples

How Do You Use it?

Just add the class tooltip to the element that you want to hover over and display the tooltip.

Then add the data attribute data-tooltip to the element and provide whatever text you would like the tooltip to say inside of it.

Then to position it, add one of the following classes:
tooltip--nw tooltip--n tooltip-ne
tooltip--w tooltip-e
tooltip--sw tooltip--s tooltip--se

Example Setup

<i class="icon-info tooltip tooltip--se" data-tooltip="This is an informational icon"></i>

Configuration Options

The following options are available to configure the tooltip, with their default values shown below. Rather than directly changing the variables in this file, override them in your own code by simply declaring them with the values you would like.

Width

$tooltip-width: 200px !default;

Distance from Element

$tooltip-proximity: 3px !default;

Fade in delay

$fade-in-delay: 300ms !default;

Fade out delay

$fade-out-duration: 300ms !default;

Triangle height

$tooltip-triangle-height: 6px !default;

Content data attribute name

$tooltip-data-attribute: 'data-tooltip' !default;

Tooltip class name

$tooltip-class: 'tooltip' !default;

Tooltip Background color

$tooltip-background-color: #0061c8 !default;

Tooltip padding

$tooltip-padding: 10px 15px !default;

See a Demo

Demo on Hacking UI

Download

Download and add the tooltips.scss file to your SCSS directory

Or install with Bower

bower install scss-tooltips

Credits:

Brought to you by @hackingui

scss-tooltips's People

Contributors

dmtintner avatar vsternbach avatar michalse avatar

Watchers

Serg Matuha avatar James Cloos 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.