Skip to content

lorenzocadamuro/pseudo-content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pseudo content

Read the content of a pseudo-element.

Install

npm install pseudo-content

Use

@media (max-width: 414px) {
  #foo:before {
    content: 'mobile';
  }
}
var foo = document.getElementById('foo');

// as second parameter you can pass the pseudo element as string - 'before' or 'after'
var fooPseudoContent = pseudoContent(foo);

console.log(fooPseudoContent.get()); // mobile
console.log(fooPseudoContent.is('mobile')); // true

About

Read the content of a pseudo-element

Resources

Stars

Watchers

Forks

Packages

No packages published