An open API service indexing awesome lists of open source software.

https://github.com/codenameyau/stylesheet

:package: Create sylesheets with JavaScript
https://github.com/codenameyau/stylesheet

Last synced: 9 months ago
JSON representation

:package: Create sylesheets with JavaScript

Awesome Lists containing this project

README

          

# stylesheet

Wrapper for stylesheets with JavaScript.

```
bower install stylesheet --save-dev
```

## Usage Example

```javascript
var stylesheet = new StyleSheet();

// Specify the selector to work on.
stylesheet.setSelector('.pause-hud');

// Insert rules.
stylesheet.insertRule('width: 100%');
stylesheet.insertRule('height: 100%');
stylesheet.insertRule('display: none');
stylesheet.insertRule('z-index: 100');
stylesheet.insertRule('background: rgba(0, 0, 0, 0.5)');
stylesheet.insertRule('cursor: default');

// Apply rules.
stylesheet.applyRules();
```