Closed dimaip closed 10 years ago
We've talked about this in the past and decided that it shouldn't be part of the core hologram gem. However, @bigethan wrote a really cool plugin that lets you click on a particular class name and shows the css rules for that class.
Thanks, I'm aware of that plugin, but it's not what I need. Sometimes it's really useful to be able to see at a glance what properties have been modified in this particular block. And I want to use original SCSS, not compiled CSS. I don't know how to write such plugin, as I would have to modify the parser, and I don't want to fork your plugin.
Anyways, for now I use this little hack to put CSS blocks side by side to HTML source blocks.
$(".main > .codeBlock").each(function(){
var prevCodeExample = $(this).prev(".codeExample");
prevCodeExample.addClass("floatBlocks");
$(this).appendTo(prevCodeExample);
});
<style>
div.floatBlocks{
overflow: auto;
}
div.floatBlocks div.codeBlock{
float: left;
}
div.floatBlocks div.codeBlock:nth-child(2){
width: 66%;
border-right: 1px solid #ccc;
}
div.floatBlocks div.codeBlock:nth-child(3){
width: 33%;
}
</style>
Nah, been there, done that. Hologram does it with style, and I'm loving it.
Maybe some day you will return to this feature request, it's not too hard to implement, but super useful to some, especially those who heavily rely on SASS.
Feel free to make a PR with this feature. But it seems like something a plugin + custom_render would be able to handle better (right now hologram knows very little about the actual source files aside from the documentation blocks). Plugin support will come soon hopefully, I'll see if this something that could be implemented there.
I'll wait until you develop that plugin api and see what I can do. Not a big fan of Ruby though)
Sent from mobile. On Jun 26, 2014 12:51 AM, "JD Cantrell" notifications@github.com wrote:
Feel free to make a PR with this feature. But it seems like something a plugin + custom_render would be able to handle better (right now hologram knows very little about the actual source files aside from the documentation blocks). Plugin support will come soon hopefully, I'll see if this something that could be implemented there.
— Reply to this email directly or view it on GitHub https://github.com/trulia/hologram/issues/129#issuecomment-47156885.
I find it really useful to see CSS code in the styleguide, but it would be really clumsy to duplicate all of the CSS declarations to the comment block by hand... It could be a really handy feature if Hologram would take all of the CSS rules untill the next comment block, and past them alongside html_example. Don't you think?