Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README: Add how it works section and change cssess to CSSess
- Loading branch information
Showing
1 changed file
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
cssess | ||
CSSess | ||
====== | ||
|
||
cssess is a JS tool that helps find extra CSS rules on your site. It is designed to be used as a bookmarklet. | ||
CSSess is a JS tool that helps find extra CSS rules on your site. It is designed to be used as a bookmarklet. | ||
|
||
The name cssess comes from the word secess and is pronounced the same way. secess means withdraw or retreat. | ||
The name CSSess comes from the word secess and is pronounced the same way. secess means withdraw or retreat. | ||
|
||
It was inspired by Helium (https://github.com/geuis/helium-css/). cssess has many improvements over Helium: | ||
It was inspired by Helium (https://github.com/geuis/helium-css/). CSSess has many improvements over Helium: | ||
|
||
* Helium depends on querySelectorAll, restricting use to the latest browsers. cssess uses jQuery as a selector engine. | ||
* Helium requires that you add URLs to check manually. cssess will spider all same domain links on the current page. | ||
* Helium was designed to be included within the page. cssess is designed to be used as a bookmarklet. | ||
* Helium depends on querySelectorAll, restricting use to the latest browsers. CSSess uses jQuery as a selector engine. | ||
* Helium requires that you add URLs to check manually. CSSess will spider all same domain links on the current page. | ||
* Helium was designed to be included within the page. CSSess is designed to be used as a bookmarklet. | ||
|
||
To install as a bookmarklet use the following in a bookmark URL: | ||
|
||
javascript:(function(d,t){var j=d.createElement(t),s=d.getElementsByTagName(t)[0]||d.getElementsByTagName("link")[0];j.src='https://github.com/driverdan/cssess/raw/master/cssess-min.js';s.parentNode.insertBefore(j,s);})(document,"script"); | ||
javascript:(function(d,t){var j=d.createElement(t),s=d.getElementsByTagName(t)[0]||d.getElementsByTagName("link")[0];j.src='https://github.com/driverdan/CSSess/raw/master/CSSess-min.js';s.parentNode.insertBefore(j,s);})(document,"script"); | ||
|
||
To use the un-minified version replace cssess-min.js with cssess.js. | ||
To use the un-minified version replace CSSess-min.js with CSSess.js. | ||
|
||
How It Works | ||
------------ | ||
|
||
Each URL is loaded into a hidden iframe. Once the iframe has finished loading all of the stylesheets and inline styles are checked against the DOM to find unused styles. | ||
|
||
Notes | ||
----- | ||
|
||
* cssess will not work cross-domain due to browser security restrictions. | ||
* CSSess will not work cross-domain due to browser security restrictions. | ||
* Contributions are welcome. Feel free to fork on github and submit a pull request. |