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
- Host: GitHub
- URL: https://github.com/codenameyau/stylesheet
- Owner: codenameyau
- License: mit
- Created: 2015-06-21T01:35:33.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-22T13:20:10.000Z (about 11 years ago)
- Last Synced: 2025-09-24T21:27:12.974Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
```