Skip to content

WebReflection/hyperhtml-style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyperHTML Style

Build Status Coverage Status Greenkeeper badge WebReflection status

The hyperHTML's html/svg style updater.

  • CDN as global utility, via https://unpkg.com/hyperhtml-style
  • ESM via import hyperStyle from 'hyperhtml-style'
  • CJS via const hyperStyle = require('hyperhtml-style')

Live test

Example

The tagger accepts a node and returns a function that can be used to update the node style either via an object or a string.

var bodyStyle = hyperhtmlStyle(document.body);
bodyStyle({
  fontFamily: 'sans-serif',
  fontSize: 16,
  '--cssProperty': 'value'
});

console.log(document.body.style.cssText);

// font-family: sans-serif;
// font-size: 16px;
// --cssProperty:value;

About

The hyperHTML's html/svg style updated.

Resources

License

Stars

Watchers

Forks

Packages

No packages published