daveaglick / FluentBootstrap

Provides extensions, helper classes, model binding, and other goodies to help you use the Bootstrap CSS framework from .NET code.
http://www.fluentbootstrap.com
MIT License
200 stars 76 forks source link

SetBackgroundState does not override default #69

Closed fairking closed 7 years ago

fairking commented 7 years ago

The SetBackgroundState does not override default

E.g. the following razor @(Html.Bootstrap().InputButton("Log In", buttonType: ButtonType.Submit) .SetBackgroundState(BackgroundState.Primary))

gives <input type="submit" value="Log In" class="btn btn-default bg-primary">

so it looks like default background is applied bootstrap_button_background

fairking commented 7 years ago

For the time being I've solved a problem by following workaround:

@(Html.Bootstrap().InputButton("Log In", buttonType: ButtonType.Submit) .SetBackgroundState(BackgroundState.Primary) .RemoveCss("btn-default"))

daveaglick commented 7 years ago

Glad you've got a workaround (for this issue at least). I've seen this and your other issues - it's a holiday weekend here and I'm trying to stay off of the computer :smile: I'll take a look at everything early next week.

daveaglick commented 7 years ago

The problem here is that button state and background state actually mean two different things and FluentBootstrap doesn't treat them as mutually exclusive. What you probably want to do is:

@(Html.Bootstrap().InputButton("Log In", buttonType: ButtonType.Submit).SetState(ButtonState.Primary))

Feel free to please reopen the issue if I've misunderstood.