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

Incorrect validation icon padding #2599

Closed
buismaarten opened this issue Feb 16, 2019 · 12 comments · Fixed by #2607
Closed

Incorrect validation icon padding #2599

buismaarten opened this issue Feb 16, 2019 · 12 comments · Fixed by #2607

Comments

@buismaarten
Copy link

buismaarten commented Feb 16, 2019

Since I've updated to Bootstrap 4.3, the validation icon is not correct aligned. The icon is too much aligned to the right side.

image

@jacobmllr95
Copy link
Member

@buismaarten Can you create a demo on CodePen, CodeSandbox or JSFiddle to confirm that this is directly related to BootstrapVue or if it is an issue with Bootstrap itself.

@tmorehouse
Copy link
Member

Looking at the Bootstrap V4.3 docs I can see that the padding appears correctly:

image

But it is not padding that positions the validation icon, it is background image positioning.

@tmorehouse
Copy link
Member

Looking at the custom SCSS we have for form-input, it only applies to type color and custom ranges.

It might be something in the docs CSS that may be affecting this (docs only?)

@mosinve
Copy link
Member

mosinve commented Feb 16, 2019

I checked BV docs site, and it seems to show icons correct way
image

@mosinve
Copy link
Member

mosinve commented Feb 16, 2019

So @buismaarten, please provide us your example, that reproduce the issue, to continue further investigations :)

@buismaarten
Copy link
Author

I've done some more research.

This problem only applies when I run npm run prod (yes, I'm using Laravel Mix)
This builds the CSS for production usage.

So I think the problem is not with bootstrap-vue. I thought this because I recently updated some packages related to Bootstrap and since then I have this problem.

@tmorehouse
Copy link
Member

It appears to be only affecting DOCs site... pasting code into playground (see issue) and exporting to JS Fiddle it works fine (no issue).

@tmorehouse
Copy link
Member

tmorehouse commented Feb 16, 2019

In the docs site the validation icon positioning is:

background-position: 100% calc(.375em + .1875rem);

But in source, it is:

background-position: center right calc(.375em + .1875rem);

Something is changing this during docs generation (prod, not dev).

@buismaarten
Copy link
Author

Yes, I have noticed the same on my environment.

Could this problem be with Webpack or something?

@tmorehouse
Copy link
Member

Nuxt.JS uses cssnano for post CSS processing/minification. So it might be related to cssnano/cssnano#701

@tmorehouse
Copy link
Member

tmorehouse commented Feb 16, 2019

changing the bootstrap CSS from:

background-position: center right calc(0.375em + 0.1875rem);

to:

background-position: right calc(0.375em + 0.1875rem) center;

fixes the issue.

Not sure if it is a cssnano issue, or if it is a bootstrap issue.

Based on MDN, this fix appears to be a preferred order.

@tmorehouse
Copy link
Member

Opened a new issue at cssnano: cssnano/cssnano#712

as it is confirmed that it is indeed a cssnano bug.

tmorehouse added a commit that referenced this issue Feb 16, 2019
Temporary fix for cssnano bug: cssnano/cssnano#712

"Fixed" by moving center to last value in background-position property

Bug will/may affect Nuxt.JS users
#2599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants