geuis / helium-css Goto Github PK
View Code? Open in Web Editor NEWHelium - javascript tool to scan your site and show unused CSS
Helium - javascript tool to scan your site and show unused CSS
The text area and buttons have a default background-color of #fff.
However, they're inheriting styles for color from other css within the page. If this also happens to be white then my text can't be seen.
Does helium-css only work locally or can also be used to test remote websites ?
Is there a dust in your code at line 317 ('t' at the end of the line) ?
and also var "style" seems to be not declared prior line 72.
Helium should check for style elements on the page, and check if those styles are matched.
I have the helium file linked in the head section of my .NET master page and have the init snippet in the body. When I load the page, I get the following error:
Uncaught TypeError: Cannot read property 'length' of null on line 462 of helium.js
Is this a configuration issue on my end?
Thank you,
Mike
cause helium.data.stylesheets.sort(); is not a function error
Need to refactor this code from top to bottom.
If user enters a url that doesn't load Helium, the app could be put into a state where the browser is continually redirected back to the broken link. Need to handle the broken link in a more user friendly way. Current solution is to 'delete localStorage.cssdetect' from the console and start over.
When testing from asp.net development server, the address for css file is http://localhost:3996/asset.axd?name=css&v=1.0.0.0 but the get request is to http://localhost/asset.axd?name=css&v=1.0.0.0 and it fails.
Do it. Also fix shitty current tests.
How many loops of the page list should this script go through? I am wondering if it is working properly. I've been through every page at least 3 times now.
Thanks for the great work. If you could let me know if this is normal operation, I would appreciate it a lot!
Pretty self-explanatory, I think.
It would be nice to be able to exclude some CSS files, like Foundation files, because we just need to check our custom .css and not the Foundation ones, and it really takes place for nothing.
The findstylesheets function only works for full paths and absolute paths. If a CSS file has a relative path (eg "css/style.css") it will be appended to the site's domain without taking the rest of the path into account (eg "www.domain.comcss/style.css" instead of "www.domain.com/correct/path/css/style.css").
72 Line: helium.$('body')[0].appendChild(style);
If localStorage is disabled the script will not work. This should be handled using a try catch around localStorage calls to inform the user they need to enable it. It could also fallback to other storage methods (eg cookies).
I carefully followed the readme, so I was surprised when a dialog popped up asking me for pages to run on. I just installed it in a page. It's confusing, because I have no idea what it's asking for.
If you absolutely have to show this part of the interface to everyone, pre-populate it with the page I've installed it into. So if the page I'm running helium in is called test page.html then the list of pages should have testpage.html in there. If you can't dynamically add the page I'm currently on, just throw in a sample
"index.html, contact.html"
This will make it clear to the user that this is a request for filename, and also how they would enter multiple filenames.
I've modified my repo to have this fix. Let me know if you want me to contribute. I just want to make the UI as clean as possible.
I'm looking for a way to export all used css to a new file. I don't see any API to helium it just inits()?
HI @geuis,
I'm Peter from cdnjs.com,
I wonder if you would like to add cdn info in the readme and github page?
This is the page we provide cdn for helium-css - https://cdnjs.com/libraries/helium-css
Thanks!
I have a problem using helium in localhost installation.
Any hint what I'm doing wrong? Or is this an error?
This shouldn't really be an issue, but since github doesn't have support for feature requests:
Around the beginning of the month, I started working on adding additional functionality to helium to provide support for inline stylesheets and for resolving and processing statements like:
@import url(somefolder/another_stylesheet.css);
Unfortunately, I ran into an issue with the ajax call being pre-maturely aborting and returning blank (almost like how it would if you were attempting an unauthorized cross-domain request), and then I ended up getting too busy with work stuff to return to it. Anyways, I figured if you were interested in that functionality and had time, I'd provide what I've written thus far, since it's just been sitting in my workspace for a few weeks now. If you don't have time but are interested in the functionality, I'll probably get back around to it when things at work start to calm down.
Anyways, I've pushed what I have so far over at my fork. I didn't want to mess up the indentations again, so I wrote it in a new file as a wrapper around the existing helium object, allowing it to be loaded as:
<script src="js/helium.js" type="text/javascript"></script>
<script src="js/helium.additional.js" type="text/javascript"></script>
Helium doesn't take media queries into account. Need to find a way to resize the browser window to test them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.