Reputation: 3358
I create a lot of html and css pages. Is there a way to markup an html file, than generate a css file from the markup.
Here's what i'm thinking:
Example Markup
<body id="home">
<section id="main">
<article>
<p>Some content</p>
</article>
</section>
<aside>
<article>
<p>Some more content</p>
</article>
</aside>
</body>
Example of generated CSS
#home { }
#home #main { }
#home #main article { }
#home #main article p { }
#home aside { }
#home aside article { }
#home aside article p { }
Upvotes: 3
Views: 1632
Reputation: 10780
Yes, there is: parse the HTML and walk the DOM tree to generate your skeleton CSS file.
PS: that IS very impractical CSS.
Upvotes: 2