Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button alignment in aligned form (on small screen sizes) #469

Closed
prjm opened this issue Mar 23, 2015 · 7 comments
Closed

Button alignment in aligned form (on small screen sizes) #469

prjm opened this issue Mar 23, 2015 · 7 comments

Comments

@prjm
Copy link

prjm commented Mar 23, 2015

On small screen sizes, the vertical alignment of different button kinds differs
(using an aligned form and the 'pure-controls' button container)

On larger screens:

image

On smaller screens:

image

Demo here: http://jsfiddle.net/prjm/vuz8m663/

Am I missing something?

@jamesalley
Copy link
Contributor

The problem is with the margin on the submit button. To fix this problem immediately, adjust the margin for .pure-form button[type=submit]. I will leave this issue open, I might need to fix that margin in Pure.

@jamesalley
Copy link
Contributor

In other words, this has nothing to do with the form being pure-form-aligned or with using the pure-controls construct, or the screen size per se. Wait, actually it IS tied to a media query:

@media only screen and (max-width :480px) {
    .pure-form button[type=submit] {
        margin: .7em 0 0
    }

I'm investigating why this is the case.

@jamesalley
Copy link
Contributor

So, this rule was written to give submit buttons a little extra margin when the screen size is small and the buttons tend to stack vertically. I think this decision should be revisited and possibly this declaration should be removed. This will take some time to consider and test, so I'll create a task for myself.

For now, you can either change the margin as I mentioned above, or just use an input instead of a button. That is, change <button type="submit" ...> to <input type="submit" ...>

@arnoldsandoval
Copy link

@jamesalley thought that might be the case - I was looking around the docs for full-width buttons (trying to familiarize myself with the codebase) can you point me to where that is? I didn't see it in the buttons section.

@jamesalley
Copy link
Contributor

I don't think there are any full-width button constructs, you'll have to add a class for that yourself.

@jamesalley
Copy link
Contributor

e.g.,

.full-width {
    width: 100%;
}

Pretty trivial customization to do yourself. We try not to add too many features to Pure, as it would get big and feature discovery would be tough.

@prjm
Copy link
Author

prjm commented Mar 24, 2015

Thank you for the quick support.
I was just wondering why the margin was applied only to submit buttons.
Of course, its a good idea to maximize buttons on small screens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants