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

fieldset disabled styles #1682

Merged
merged 5 commits into from
Oct 31, 2018
Merged

fieldset disabled styles #1682

merged 5 commits into from
Oct 31, 2018

Conversation

samburgers
Copy link
Contributor

Adds disabled styles for <fieldset disabled>

@stern-shawn
Copy link
Contributor

👍
Would love to have this added. As it is now with Bulma, I'm having to manually assign the disabled attribute to all elements in a fieldset to ensure expected styling.

@samburgers
Copy link
Contributor Author

Some further explanation to the pull request in hope to get it merged.

Example markup:

<fieldset disabled>
    <div class="field">
        <label class="label">
            Email
        </label>
        <p class="control has-icons-left">
            <input class="input" type="text" placeholder="Email">
            <span class="icon is-small is-left">
                <i class="fa fa-envelope-o"></i>
            </span>
        </p>
    </div>
    <div class="field">
        <label class="label">
            Password
        </label>
        <p class="control has-icons-left">
            <input class="input" type="password" placeholder="Password">
            <span class="icon is-small is-left">
                <i class="fa fa-lock"></i>
            </span>
        </p>
    </div>
    <div class="field is-grouped">
        <p class="control">
            <button class="button is-success">
                Sign In
            </button>
        </p>
        <p class="control">
            <button class="button">
                Login
            </button>
        </p>
    </div>
</fieldset>

Current behaviour:

<fieldset disabled> naturally disables form/button elements in all browsers, but they visually appear still active in Bulma:

screen shot 2018-03-31 at 6 07 18 pm

Proposed change:

This pull request scaffolds the Bulma pre-existing disabled styles for inputs and buttons for when a surrounding <fieldset> element is set to disabled.

screen shot 2018-03-31 at 6 07 47 pm

Tested with modifiers such as is-loading class:

screen shot 2018-03-31 at 10 26 01 pm

Reasoning:

Disabling inputs on a fieldset level is handy for multi-step forms, and reactive view frameworks.

Caveats:

The <fieldset> element could also do with a border reset, which I have also submitted a pull request here:
jgthms/minireset.css#12

Alternatives:

All of this could be alternatively be managed with a .fieldset class to perhaps align a bit closer to Bulma conventions, however this could lead to confusion or misalignment with browser behaviour.

Copy link
Owner

@jgthms jgthms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

Can you:

  • not build the CSS file
  • update the Changelog
  • add some documentation

Thanks.

@urin
Copy link

urin commented Apr 10, 2018

Also it may be better to modify disabled style of pagination.sass also.

# Conflicts:
#	css/bulma.css
#	css/bulma.css.map
Copy link
Owner

@jgthms jgthms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot the comma on the previous line in each selector.

@samburgers
Copy link
Contributor Author

Thanks, I just caught that too... pushing down a fix and also resetting the fieldset element. As for adding to the documentation, would you prefer a snippet example in the /forms/general page? Or a small snippet under each "Disabled" section on each form element page?

@jgthms
Copy link
Owner

jgthms commented Apr 14, 2018

Both! Since users might be reading one page or the other, but not both.

On the general page you can add a section called “Disabled forms” where you put a whole form.

On the other pages, just put a link to this new section (with an anchor) with the phrase “You can also disable an input/button/select… by placing it within a disabled form”.

Something like that. Also try to put it behind a flag (search for “vernum” in the docs).

If that’s too much, just put something here, I’ll take care of the rest.

Oh and update the change log please. Thanks! 👍

@diomed
Copy link
Contributor

diomed commented Oct 25, 2018

@samburgers do you plan to revisit and update this?

@samburgers
Copy link
Contributor Author

Thanks for the bump, will revis this weekend!

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

Successfully merging this pull request may close these issues.

5 participants