MIGHTYminnow / mm-components

[WordPress] Custom components and functionality for WordPress.
3 stars 2 forks source link

Custom heading improvements #78

Closed carrieforde closed 9 years ago

carrieforde commented 9 years ago

So, I'd like to think that I've improved the Custom Heading, and I hope you will agree!

I've rewritten a bunch of the component code so that it matches our updated Mm Component structure (i.e. using the $defaults array, checking whether class options have been added to minimize extra spaces, etc.).

After much pain, I figured out how to wrap the heading in a link when one is passed. No pain, no gain, right?

I thought passing an array of allowed pixel values seemed really weird for a Custom Heading, so I decided to make that an arbitrary value that the user can pass, so it works just like the margin bottom. If no value is passed, it inherits the size of the heading from the theme.

The Sass is so simple for this because I was able to utilize so many of our helpful global text styles, and the rest of the formatting can be handled by the theme's styling.

I'm looking forward to seeing if there are any further improvements to be made.

BraadMartin commented 9 years ago

There's a lot of great stuff in here. Nice work! I'm going to merge it and start playing with it.