Skip to content

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

@Tickthokk

Description

@Tickthokk

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions