MIT License

项目介绍

chinchang/hint.css 是一个托管在 GitHub 上的开源项目,主要使用 CSS 编写,采用 MIT License 许可证,目前获得 8.4k 个 Star、670 次 Fork。

仓库全名
chinchang/hint.css
开源许可证
MIT License
Star 数
8.4k
Fork 数
670
未关闭 Issue
43

README 摘要

A tooltip library in CSS for your lovely websites Demo • Get started • Who's using this? • Browser support • FAQs • Contributing • 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

hint.css 用什么语言开发?

主要使用 CSS 编写,采用 MIT License 许可证,目前有 8.4k 个 Star。

hint.css 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 hint.css 的源码?

可以直接克隆仓库:git clone https://github.com/chinchang/hint.css.git,默认分支为 master;安装与运行步骤见仓库 README。

hint.css 最近还在维护吗?

仓库最近一次更新为 2024年10月17日,当前有 43 个未关闭 Issue;Star 数为 8.4k,可作为社区活跃度的参考。

简要分析

热度分
9924
价值分
5265
活跃状态
活跃

语言占比

CSS
HTML
JavaScript
SCSS

Release

README

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

A tooltip library in CSS for your lovely websites

Demo • Get started • Who’s using this? • Browser support • FAQs • Contributing • 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

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: https://www.jsdelivr.com/package/npm/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" />

or

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

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--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.

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

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

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, @necolas for their awesome articles on BEM and to @joshnh through whose work I came to know about it :)

评论

暂无评论