jgthms / wysiwyg.css

A tiny CSS for generated HTML or Markdown content
https://jgthms.com/wysiwyg.css/
MIT License
707 stars 65 forks source link

Add :empty paragraph selector #3

Closed furzeface closed 7 years ago

furzeface commented 7 years ago

I always have problems with CMS content producing lots of empty elements, mainly paragraphs - the empty text elements still inherit margins etc leading to large spacing between content.

I usually write in these styles to hide empty paragraphs with the :empty pseudo class.

I was tempted to add :empty to a few other selectors but wanted to start with paragraph as it’s the main use case, and wanted to know your thoughts on it.

:octocat:

jgthms commented 7 years ago

Oh, very neat idea! It is actually a very common case that I've come across many times. I never thought about using that pseudo selector.

furzeface commented 7 years ago

🙂 great stuff, thanks!