Skip to content

Javascript that creates dynamic fake styles for pseudo-classes like :hover,:active,:focus and :visited. Useful to show different states in styleguides.

License

Notifications You must be signed in to change notification settings

justb81/jsFakePseudoClasses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Fake Pseudo Classes Generator

This javascript generates fake classes in the browser for any defined styles containing pseudo-classes like :focus or :hover.

You can use these classes in your styleguide to show styles that else would been hidden or need to be defined separately in your general production stylesheet.

Usage

  1. include the javascript-file at the bottom of your html-file.
  2. use fake-classes on your elements
  • fake-hover for hovering state of an element
  • fake-focus to show what an element looks when it is focused
  • fake-target to show what an element looks when it is targeted
  • fake-active for the active state of a link
  • fake-visited for the visited state of a link
  • fake-valid for the valid state of an input element
  • fake-invalid for the visited state of an input element
  1. set a data attribute data-debug="true" on the script tag and see some debug output.

Example

For an example look at tests/index.html

License

MIT License

About

Javascript that creates dynamic fake styles for pseudo-classes like :hover,:active,:focus and :visited. Useful to show different states in styleguides.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published