My HTML is all marked up, ready to make it rain CSS. The problem is that I have to go back and find out what all my id and class names are so I can get started. What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready to be styled (maybe even with some defaults). Does such a tool exist?
Skeleton is a light-weight, responsive, and highly customizable CSS library built with mobile in mind. There's zero compiling or installing necessary, and it works well with additional CSS stylesheets and front-end Frameworks. Use skeleton for quick, up-and-running CSS that's great for demos or MVPs.
Create a new file index. html and write some HTML for the layout inside a parent <div> with class=”profile-container”. Add class=”skeleton” to every element in order to apply the skeleton screen loading effect. You'll be removing this class when the content is loaded using JavaScript.
Skeleton loaders are visual placeholders for information while data is still loading. Anatomy. A skeleton loader provides a low fidelity representation of the interface that will be loaded.
I have a poor man's version of this I have used in the past... this requires jquery and firebug...
<script type="text/javascript">
$(document).ready(function() {
$('*[@id]').each(function() {
console.log('#' + this.id + ' {}');
});
$('*[@class]').each(function() {
$.each($(this).attr('class').split(" "), function() {
console.log('.' + this + ' {}');
});
});
});
</script>
it gives you something like this:
#spinner {}
#log {}
#area {}
.cards {}
.dialog {}
.controller {}
if you want them in "natural" page order instead...
<script type="text/javascript">
$(document).ready(function() {
$('*').each(function() {
if($(this).is('[@id]')) {
console.log('#' + this.id + ' {}');
}
if($(this).is('[@class]')) {
$.each($(this).attr('class').split(" "), function() {
console.log('.' + this + ' {}');
});
}
});
});
</script>
I just load the page with that script in there, then cut and paste the results out of firebug... then obviously, remove the script :)
you'll need to remove the dups manually or just toss in some simple dup checking logic with a map or array or something.. one for IDs and one for classes.
When I first saw this, I thought "Great question! Neat answer, danb!"
After a little thought, I'm not so sure this is a good idea. It's a little like generating event handlers for all controls in an ASP.NET page, or generating CRUD procedures for all tables in a database. I think it's better to create them as needed for two reasons:
http://lab.xms.pl/css-generator/ seems to fit the description.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With