Repository: chinchang/hint.css
Branch: master
Commit: e9281cf24369
Files: 26
Total size: 54.7 KB
Directory structure:
gitextract_qipwe67b/
├── .editorconfig
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .prettierignore
├── CONTRIBUTING.md
├── Gruntfile.js
├── LICENSE
├── README.md
├── bower.json
├── component.json
├── demo.html
├── hint.base.css
├── hint.css
├── package.json
└── src/
├── hint-always.scss
├── hint-color-types.scss
├── hint-core.scss
├── hint-effects.scss
├── hint-mixins.scss
├── hint-position.scss
├── hint-rounded.scss
├── hint-sizes.scss
├── hint-theme.scss
├── hint-variables.scss
├── hint.base.scss
└── hint.scss
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
patreon: kushagra
custom: https://paypal.me/kushagragour
================================================
FILE: .gitignore
================================================
.sass-cache
node_modules/
hint.sublime-project
hint.sublime-workspace
*.map
================================================
FILE: .prettierignore
================================================
hint.css
hint.min.css
hint.base.css
hint.base.min.css
================================================
FILE: CONTRIBUTING.md
================================================
**Hint** is written in [SASS](http://sass-lang.com/).
# Setup
1. [Fork **Hint.css**](https://help.github.com/articles/fork-a-repo) and clone it on your system.
2. Create a new branch out off `master` for your fix/feature. `git checkout new-feature master`
# Building
**Hint.css** uses [Grunt](http://gruntjs.com/) for the build process which you need to have installed on your system.
Also there are four additional Grunt tasks required to build the library:
1. [grunt-contrib-cssmin](https://npmjs.org/package/grunt-contrib-cssmin)
2. [grunt-sass](https://www.npmjs.com/package/grunt-sass)
3. [grunt-contrib-concat](https://www.npmjs.com/package/grunt-contrib-concat)
4. [grunt-contrib-watch](https://www.npmjs.com/package/grunt-contrib-watch)
To install all the dependencies, run `npm install`.
Once you have the dependencies installed, run `npm run dev` from the project directory. This will start watching all the files in `src/` and run the default grunt task which compiles the SCSS files into `hint.css` file. You can then test your changes in `demo.html`.
Though this should be sufficient for building the library for testing, in case you want to build the minified version as well you can run the `grunt deploy` command instead.
# Things to remember
- Do not fix multiple issues in a single commit. Keep them one thing per commit so that they can be picked easily incase only few commits require to be merged.
- For every new modifier (example `hint--success`, `hint--top`) added, make a separate file unless it fits into a current modifier file.
- Before submitting a patch, rebase your branch on upstream `master` to make life easier for the merger.
- **DO NOT** add the library builds (`hint.css` & `hint.min.css`) in your commits.
# Stay in touch
Best place to get in touch regarding this library is the [issues board on Github](https://github.com/chinchang/hint.css/issues).
================================================
FILE: Gruntfile.js
================================================
/*global module:false*/
const sass = require("sass");
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
meta: {
getBanner: function () {
return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= meta.banner %>";
},
getBannerForBaseVersion: function () {
return "/*! <%= pkg.title || pkg.name %> (base version) - v<%= pkg.version %> - <%= meta.banner %>";
},
banner:
'<%= grunt.template.today("yyyy-mm-dd") + "\\n" %>' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> */\n\n',
},
sass: {
options: {
implementation: sass,
sourceMap: false,
},
dist: {
files: {
"<%= pkg.name %>.css": "src/<%= pkg.name %>.scss",
"<%= pkg.name %>.base.css": "src/<%= pkg.name %>.base.scss",
},
},
},
cssmin: {
options: {
sourceMap: false,
},
compress: {
files: {
"<%= pkg.name %>.min.css": ["<%= pkg.name %>.css"],
"<%= pkg.name %>.base.min.css": ["<%= pkg.name %>.base.css"],
},
},
},
// concat banner to final lib files
concat: {
options: {
banner: "<%= meta.getBanner() %>",
},
lib: {
src: ["<%= pkg.name %>.css"],
dest: "<%= pkg.name %>.css",
},
minLib: {
src: ["<%= pkg.name %>.min.css"],
dest: "<%= pkg.name %>.min.css",
},
baseLib: {
options: {
banner: "<%= meta.getBannerForBaseVersion() %>",
},
src: ["<%= pkg.name %>.base.css"],
dest: "<%= pkg.name %>.base.css",
},
baseMinLib: {
options: {
banner: "<%= meta.getBannerForBaseVersion() %>",
},
src: ["<%= pkg.name %>.base.min.css"],
dest: "<%= pkg.name %>.base.min.css",
},
},
watch: {
files: "src/*.scss",
tasks: "default",
},
});
// Dependencies
grunt.loadNpmTasks("grunt-sass");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-watch");
// Default task.
grunt.registerTask("default", "sass");
grunt.registerTask("deploy", ["sass", "cssmin", "concat"]);
};
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2021 Kushagra Gour
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Hint.css [](https://badge.fury.io/js/hint.css)  [](https://gitter.im/chinchang/hint.css?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 
_A tooltip library in CSS for your lovely websites_
[Demo](https://kushagra.dev/lab/hint/) • [Get started](#get-started) • [Who's using this?](#whos-using-this) • [Browser support](#browser-support) • [FAQs](#faqs) • [Contributing](#contributing) • [License](#license)
`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
- [unminified] : https://raw.github.com/chinchang/hint.css/master/hint.css
- [minified] : https://raw.github.com/chinchang/hint.css/master/hint.min.css
Base build _(Does not include color themes and fancy effects)_
- [unminified] : https://raw.github.com/chinchang/hint.css/master/hint.base.css
- [minified] : https://raw.github.com/chinchang/hint.css/master/hint.base.min.css
2. **Bower** : `bower install hint.css`
3. **npm**: `npm install --save hint.css`
4. **CDN**: [https://www.jsdelivr.com/package/npm/hint.css](https://www.jsdelivr.com/package/npm/hint.css) or [https://cdnjs.com/libraries/hint.css](https://cdnjs.com/libraries/hint.css)
Now include the library in the `HEAD` tag of your page:
```html
```
or
```html
```
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](https://webaccessibility.withgoogle.com/unit?unit=6&lesson=10).
```html
Hello Sir, hover me.
```
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--fit`
- `hint--always`
- `hint--rounded`
- `hint--no-animate`
- `hint--bounce`
- `hint--no-arrow`
- `hint--no-shadow`
## 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](./CONTRIBUTING.md).
## Who's Using This?
- [Webflow Playground](http://playground.webflow.com/)
- [Panda chrome app](http://usepanda.com/)
- [Fiverr](https://www.fiverr.com/)
- [Stackshare](http://stackshare.io/)
- [Siftery](https://siftery.com/)
- [LessPass](https://lesspass.com/#/)
- [Tridiv](http://tridiv.com/)
- [Alm - TypeScript IDE](http://alm.tools/)
- [Prototyp](http://prototyp.in/)
- [Tradus](http://tradus.com/)
- [Web Maker](https://webmakerapp.com)
- [Tolks](https://tolks.io)
- [Formspree](http://formspree.io/)
- [codeMagic](http://codemagic.gr/)
Are you using **hint.css** in your awesome project too? Just tweet it out to [@hint_css](https://twitter.com/hint_css) or let us know on the [mailing list](mailto:hintcss@googlegroups.com).
## Browser Support
**hint.css** works on all latest browsers
### FAQs
Checkout the [FAQ Wiki](https://github.com/chinchang/hint.css/wiki/Frequently-Asked-Questions) 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](./CONTRIBUTING.md).
## Changelog & Updates
See the [Changelog](https://github.com/chinchang/hint.css/wiki/Changelog).
To catch all updates and discussion, join the mailing list: [**hintcss@googlegroups.com**](https://groups.google.com/forum/?fromgroups=#!forum/hintcss).
Or follow on twitter: [**@hint_css**](https://twitter.com/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](https://twitter.com/csswizardry), [@necolas](https://twitter.com/necolas) for their awesome articles on BEM and to [@joshnh](https://twitter.com/_joshnh) through whose work I came to know about it :)
# Sponsor
[](https://cssbattle.dev?utm_source=hintcssrepo)
================================================
FILE: bower.json
================================================
{
"name": "hint.css",
"main": "hint.min.css",
"author": "Kushagra Gour",
"ignore": [
"CONTRIBUTING.md",
"Gruntfile.js"
],
"keywords": [
"hint",
"tooltip",
"tooltips",
"ui"
]
}
================================================
FILE: component.json
================================================
{
"name": "hint.css",
"repo": "chinchang/hint.css",
"description": "A tooltip library in CSS for your lovely websites.",
"version": "2.6.0",
"keywords": ["tooltip", "css"],
"dependencies": {},
"development": {},
"styles": [
"hint.min.css"
]
}
================================================
FILE: demo.html
================================================
Hint.css - A tooltip library in CSS
Hint.css 3.0
A pure CSS tooltip library for your lovely websites
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.
Its recommended to use aria-label attribute to specify your
tooltip text in support of accessibility. Though, you can always use
data-hint attribute instead.
Read more about aria-label here.