Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avocode/pretty-selectors
Pretty selectors take your ugly text and transform it to nice CSS selectors
https://github.com/avocode/pretty-selectors
Last synced: about 1 month ago
JSON representation
Pretty selectors take your ugly text and transform it to nice CSS selectors
- Host: GitHub
- URL: https://github.com/avocode/pretty-selectors
- Owner: avocode
- License: mit
- Created: 2014-10-06T13:50:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-04T16:18:48.000Z (almost 9 years ago)
- Last Synced: 2024-04-09T22:07:45.154Z (9 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 9.77 KB
- Stars: 7
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Pretty Selectors
================> Pretty selectors take your ugly text and transform it to nice CSS selectors.
## Installation
`npm install pretty-selectors`
## Input/Output example
![](http://f.cl.ly/items/2H3O3y0z2t46042s0J1i/Screen%20Shot%202014-10-06%20at%2015.55.37.png)
## Code example
var PrettySelectors = require('pretty-selectors');
var selector = PrettySelectors('Moje mama', {separator: 'snake',
selector: 'id',
maxWords: 3});
// result: #moje_mama## Api
PrettySelectors(text, object)
### text (string) – required
### object.separator (string, default: 'dash') – optional
Options: dash, snake, camel
### object.selector (string) – optional, default: 'class'
Options: class, id, element
### object.maxWords (number) – optional, default: 0 means no text stripping
### object.fallbackSelectorPrefix (string) – optional