Support » Reviews » Great for sharing CSS/HTML code snippets

Great for sharing CSS/HTML code snippets

  • Just installed this for my latest post where I had to show off more code than usual and it works just like expected. You can create new snippets and easily reference them in your posts using the shortcode listed in the Code Snippets screen. Neat!

    I only have two small nitpicks:

    1. There was some CSS bleed which caused the box to be way too high. It seems as if each line is always 18px tall but the line height is not enforced. I fixed it by adding line-height: 18px; to .ace_editor.

    2. Since I added the snippet through the Code Snippets editor I was first confused about how to actually reference the snippet in the post. Turns out _there is_ a way to add/insert snippets from the editor, but it’s only visible in the Visual editor. Since you’re inserting content in my mind it would make more sense if it was simply a button right next to the Upload Media button above the editor altogether.

    Great job!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hugh Lashbrooke


    Thanks Isaac!

    To respond to your two points:

    1. This is something I have been trying to find a good work around for – the line-height is different for each editor theme, so I can’t just specify 18px globally. I am working to find a way to work out the height dynamically as the editor loads and I will release an update for this once I have it worked out.

    2. Thanks for the suggestion of the placement of the snippet button – I’ll look into that for the next release.

    Would you mind posting a link to your site on here? It would be great to see your use case for the plugin.

    I see, the line-height thing sounds gnarly. Since the font size _is_ declared though, it sounds like it would be semantic to just declare a line-height as well. Otherwise if you don’t declare either and let the physical height of the elements be inherited from the parent elmenet’s line height in pixels that would probably be the best way to make sure it never breaks… I just used the default code style for now, might make it work better with the theme once I’ve launched a redesign. The post is here.

    Plugin Author Hugh Lashbrooke


    Awesome – thanks for the link! Very cool post BTW..

    I’ll look more into the line-height issue in the coming weeks – I’ve had more pressing tasks to work on so I haven’t been focussing on this, but I agree that it could use some improvement.

    Keep up the good work and continue wooing the world 😉

    Plugin Author Hugh Lashbrooke


    Thanks Isaac 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Great for sharing CSS/HTML code snippets’ is closed to new replies.