Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
chinchang committed Feb 20, 2013
2 parents 97a0211 + c680699 commit 969f613
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 24 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

*Note: CSS3 Transitions on pseudo elements is currently available on Firefox only. On rest of the browsers it degrades gracefully without any transition. Though the good news is that it will be [coming soon on webkit](https://bugs.webkit.org/show_bug.cgi?id=92591) also.*

[Read more about it](http://kushagragour.in/blog/2013/02/years-first-side-project-hint/).

###Try it out:
http://kushagragour.in/lab/hint/

Expand Down Expand Up @@ -43,6 +45,7 @@ Use it with other available modifiers in various combinations. Available modifie
- `hint--warning`
- `hint--success`
- `hint--always`
- `hint--rounded`

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

Expand Down
8 changes: 7 additions & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ <h3>A tooltip library in CSS</h3>
<a class="hint hint--bottom hint--success" data-hint="This is a success tooltip">Hurray! You have seen all 4 context types.</a>
</p>

<p>
<h3>Extra</h3>

<p>
<a class="hint hint--left hint--always" data-hint="...which always keep showing">You can also make tooltips...</a>
</p>

<p>
<a class="hint hint--top hint--rounded" data-hint="We have rounded corners for you">Hmm...So you don't like sharp edges?</a>
</p>

</body>
</html>
22 changes: 17 additions & 5 deletions hint.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Hint.css - v0.1.0 - 2013-02-03
/*! Hint.css - v1.1.0 - 2013-02-20
* https://github.com/chinchang/hint.css
* Copyright (c) 2013 Kushagra Gour; Licensed MIT */

Expand Down Expand Up @@ -87,7 +87,7 @@
border-right-color: #383838; }

/**
* top tootip
* top tooltip
*/
.hint--top:before {
margin-bottom: -12px; }
Expand All @@ -102,7 +102,7 @@
transform: translateY(-8px); }

/**
* bottom tootip
* bottom tooltip
*/
.hint--bottom:before {
margin-top: -12px; }
Expand All @@ -117,7 +117,7 @@
transform: translateY(8px); }

/**
* right tootip
* right tooltip
*/
.hint--right:before {
margin-left: -12px;
Expand All @@ -133,7 +133,7 @@
transform: translateX(8px); }

/**
* left tootip
* left tooltip
*/
.hint--left:before {
margin-right: -12px;
Expand Down Expand Up @@ -247,3 +247,15 @@
-webkit-transform: translateX(8px);
-moz-transform: translateX(8px);
transform: translateX(8px); }

/**
* source: hint-rounded.scss
*
* Defines rounded corner tooltips.
*
* Classes added:
* 1) hint--rounded
*
*/
.hint--rounded:after {
border-radius: 4px; }
4 changes: 2 additions & 2 deletions hint.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "hint",
"title": "Hint.css",
"description": "A CSS based tooltip library",
"version": "0.1.0",
"description": "A tooltip library in CSS",
"version": "1.1.0",
"homepage": "https://github.com/chinchang/hint.css",
"author": {
"name": "Kushagra Gour",
Expand Down
8 changes: 4 additions & 4 deletions src/hint-always.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
}

&.hint--top {
+set-margin('translateY', -1);
@include set-margin('translateY', -1);
}

&.hint--bottom {
+set-margin('translateY', 1);
@include set-margin('translateY', 1);
}

&.hint--left {
+set-margin('translateX', -1);
@include set-margin('translateX', -1);
}

&.hint--right {
+set-margin('translateX', 1);
@include set-margin('translateX', 1);
}
}

18 changes: 9 additions & 9 deletions src/hint-position.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,32 @@
/**
* set default color for tooltip arrows
*/
+arrow-border-color($defaultColor, 'false');
@include arrow-border-color($defaultColor, 'false');

/**
* top tootip
* top tooltip
*/
.hint--top {
+vertical-positioned-tooltip('bottom', -1);
@include vertical-positioned-tooltip('bottom', -1);
}

/**
* bottom tootip
* bottom tooltip
*/
.hint--bottom {
+vertical-positioned-tooltip('top', 1);
@include vertical-positioned-tooltip('top', 1);
}

/**
* right tootip
* right tooltip
*/
.hint--right {
+horizontal-positioned-tooltip('left', 1);
@include horizontal-positioned-tooltip('left', 1);
}

/**
* left tootip
* left tooltip
*/
.hint--left {
+horizontal-positioned-tooltip('right', -1);
@include horizontal-positioned-tooltip('right', -1);
}
15 changes: 15 additions & 0 deletions src/hint-rounded.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* source: hint-rounded.scss
*
* Defines rounded corner tooltips.
*
* Classes added:
* 1) hint--rounded
*
*/

.hint--rounded {
&:after {
border-radius: 4px;
}
}
3 changes: 2 additions & 1 deletion src/hint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
@import "src/hint-core";
@import "src/hint-position";
@import "src/hint-color-types";
@import "src/hint-always";
@import "src/hint-always";
@import "src/hint-rounded";

0 comments on commit 969f613

Please sign in to comment.