deckar01 / task_list

Markdown Task List feature components
MIT License
9 stars 7 forks source link

Remove whitespace after checkbox #11

Closed deckar01 closed 8 years ago

deckar01 commented 8 years ago

Currently the float: left style on the checkbox is required to force the trailing whitespace to collapse. Doing this also requires pushing the checkbox down with margin-top: 4px.

Explicitly removing the space and not using float: left would prevent additional whitespace from being destroyed and provide more flexibility to custom CSS layouts.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/22466 for more background.

deckar01 commented 8 years ago

Another reason this is inconsistent behavior is that using margin-top: 4px is meant to vertically center the checkbox, but it relies on the height of the line not to change. If content in the list item causes the line height to increase the checkbox stays stuck to the top of the line. The default for list bullets is to stay vertically centered with the first line.

deckar01 commented 8 years ago

float: left is required for browser compatibility. Closing until setting a checkbox's width is consistent across browsers and operating systems (looking at you OS X).