SparkPost / heml

HEML is an open source markup language for building responsive email.
https://heml.io
MIT License
4.33k stars 157 forks source link

Align attribute on Button #25

Closed nhemenway closed 6 years ago

nhemenway commented 6 years ago

Button docs state that the align attribute will work on button and that it defaults to left. Using it results in

HEMLError: Attribute align is not allowed on button.

Example:

<button href="https://heml.io" align="left">Click me!!</button>

By default the button seems to be centered. It's simple enough style the button with something like margin-left:0px; so I'm not sure if this issue is just with the heml.io docs, or if this is a planned feature enhancement or bug.

avigoldman commented 6 years ago

Yeah, this is an issue with the heml docs. It's more natural to use CSS for this. Fixed in heml.io PR#11

Soundvessel commented 6 years ago

Documentation is still inconsistent and missing details. For example https://heml.io/docs/elements/button says to center with style="margin: auto" but it is already centered by default. The only way to get it left aligned that I have found is to apply inline-block in the CSS but that isn't recommended in the example here... https://heml.io/docs/styling/using-css#changing-element-displays

michaelbrazell commented 5 years ago

Yeah, like @Soundvessel buttons seem to be center aligned no matter what, and overwriting them in CSS (e.g. adding the class align_left (with .align_left { text-align: left; } declared to a button) doesn't seem to do anything.

For what it's worth I also noticed that if a button is added without wrapping it in a <p> element then a large line of whatever the background color of the button is appears beneath it, but that's a different issue. Wrapping the button in a <p> seems to have done the trick for that one.