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

forms.less - "has-" functions using wrong variables #12731

Closed
Tickthokk opened this issue Feb 13, 2014 · 3 comments
Closed

forms.less - "has-" functions using wrong variables #12731

Tickthokk opened this issue Feb 13, 2014 · 3 comments
Labels

Comments

@Tickthokk
Copy link

I submitted this first to the SASS repository and was redirected here. I reviewed the LESS files and the issue is the same there. While I reference specific lines in .scss files, from what I saw they are practically identical in their corresponding .less files.

My syntax will obviously be wrong when talking about LESS, but the suggestion is just to change the second instance of text to border, so I didn't convert my code. Then obviously this resolution will need ported to your SASS repository as well.

Thanks!


Original SASS issue:
twbs/bootstrap-sass#531


For the three has- classes (success, warning, error), the function call is currently using the -text color variable in the first two passes, but I believe the second should be the -border color variable. This would seem to be a correct fix based on the variable definitions in mixins.scss on line 857.

As it exists now (forms.scss line 272)

.has-success {
  @include form-control-validation($state-success-text, $state-success-text, $state-success-bg);
}
.has-warning {
  @include form-control-validation($state-warning-text, $state-warning-text, $state-warning-bg);
}
.has-error {
  @include form-control-validation($state-danger-text, $state-danger-text, $state-danger-bg);
}

Suggested change:

.has-success {
  @include form-control-validation($state-success-text, $state-success-border, $state-success-bg);
}
.has-warning {
  @include form-control-validation($state-warning-text, $state-warning-border, $state-warning-bg);
}
.has-error {
  @include form-control-validation($state-danger-text, $state-danger-border, $state-danger-bg);
}
@juthilo juthilo added the css label Feb 13, 2014
@juthilo juthilo added this to the v3.2.0 milestone Feb 13, 2014
@mdo
Copy link
Member

mdo commented Feb 14, 2014

Nope, the use of the text vars twice is intentional. The border color is for the alerts, which is ~10% darker than the super light state background colors. We want dark borders to match the text color, so we use that var.

@mdo mdo closed this as completed Feb 14, 2014
@mdo mdo removed this from the v3.2.0 milestone Feb 14, 2014
@antiheld
Copy link

Came across exactly the same issue. Isn't it much more flexible to have seperate vars, for example if you have a input-group where border-color and background-color for the addon should be the same?

@mdo
Copy link
Member

mdo commented Aug 12, 2014

Nothing here will change until v4. But yes, it'd be better to improve the vars here for that.

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

No branches or pull requests

4 participants