-
I've been having this problem for a while, it didn't just start happening with Beta 1 release. The problem is that when I use Gulp and SASS to compile a custom version of Bootstrap, the resulting CSS file breaks things, mostly form items. Here's an example of using the pre-compiled version of bootstrap.css that comes with the NPM distribution, and then after I do a custom compile with SASS: Most form elements get broken after the compile. I really don't understand what I'm doing wrong. I'm using the same kind setup and gulp script I used for BS 4, which worked just fine. All I'm changing in my own SCSS file is the primary color, very simple and nothing complex. If it's any help, this is the gulp file I'm using:
This is my scss file with the customizations:
The resulting bootstrap.css file after SASS compile is 7388 lines, whereas the bootstrap.css file that comes with the distribution is 10717 lines. So there's a lot of stuff that seems to be missing, and I'm not sure why, my compile is very basic and straightforward. But I'm really not a SASS or Gulp expert at all, so I have no idea where to even begin to look for the problem. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 8 replies
-
Since posting that message, I've narrowed down the problem. It seems that the following CSS is missing from .
There is |
Beta Was this translation helpful? Give feedback.
-
https://getbootstrap.com/docs/5.0/getting-started/build-tools/#autoprefixer BTW autoprefixer is required since v4 when one is building Sass on their own. |
Beta Was this translation helpful? Give feedback.
-
I have autoprefixer installed in my NPM node_modules folder along with Bootstrap 5 beta 1. But it's still not adding the -webkit- prefix to those form elements after compiling. Is there more that I need to do to make this work? |
Beta Was this translation helpful? Give feedback.
-
Please disregard my previous post. What I ended up doing was following the Tooling Setup and that seems to have fixed my problem. I was using an older setup where I had a separate .scss file that looked like this:
And then my Gulp script (posted above) compiled everything. It kept my own customizations separate from the Bootstrap dist files. But when I follow the instructions on the Tooling Setup page, it appears that when I run So I guess I don't understand how the Tooling Setup is supposed to work or how to use it. I know CSS, but I'm a novice with SASS and NPM. If there's a tutorial somewhere I can read that would show me how to use these build tools to create customizations to bootstrap.css while allowing updates and maintaining my edits, I'd appreciate if someone could share a link. So far all the tutorials I found are for Bootstrap 4, but that setup doesn't seem to work with Bootstrap 5, based on my experience. |
Beta Was this translation helpful? Give feedback.
-
I believe you have misunderstood the tooling setup. The Tooling setup page only mentions the hard requirements and one way we do things ourselves so that contributors can start easily. You shouldn't follow that page. Instead, have a look at https://getbootstrap.com/docs/5.0/customize/overview/ and adapt things to your tooling. |
Beta Was this translation helpful? Give feedback.
-
Okay, then I guess my post about the autoprefixer is back on the table. I already have a setup similar to that outlined on the Customize page, and have autoprefixer installed in my node_modules folder, but when I compile with SASS the prefixes are still missing from |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's something on your side. If you have a .browserslistrc file in your root folder, it should work otherwise you might need to customize your setup further. |
Beta Was this translation helpful? Give feedback.
-
The root folder of your project. Nothing is node_modules matters, or should matter. We haven't really changed anything in this regard on v5. |
Beta Was this translation helpful? Give feedback.
-
Please create a test repo with the minimum dependencies and code and I'll
try and have a look tomorrow.
…On Tue, Dec 8, 2020, 22:43 MontyHu ***@***.***> wrote:
I put a copy of .browserslistrc in the root of my project folder, but the
-webkit- prefixes are still missing after compiling. I guess I'm in over my
head, something that seems so simple just won't work for me.
It would be great if the docs could contain a step-by-step tutorial on how
to set the whole environment up with npm and how to customize bootstrap
with sass and gulp. I'm using the same setup I did for BS4, but it doesn't
work with BS5.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#32369 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACVLNKX4LUFAZOUCGOV6UTST2FXPANCNFSM4URBGG4Q>
.
|
Beta Was this translation helpful? Give feedback.
-
Let me ask you this. Where should I put .browserlistrc if this is my folder structure:
There are many other folders in node_modules than listed here. I have tried putting .browserlistrc in the root /project folder, /src, /src/css, /src/scss, and node_modules. After I compile, there are no prefixes added to anything in the resulting .css file. This is my gulp.js file:
I also tried adding this to my gulp.js file just above the last line, which I got from the auotprefixer GitHub page, but still not getting any
|
Beta Was this translation helpful? Give feedback.
-
.browserslistrc should be in the root as I said:
Now, the contents of your .browserslistrc file matter too. If you use our file and everything works fine in your tooling, then you should get the prefixed appearance property in your dist directory. It's not Bootstrap that needs these tools only. These tools are needed for modern development. PS. no need to make your test project private. There's nothing to hide. Also, definitely don't commit your node_modules. You are not supposed to touch this folder EVER. |
Beta Was this translation helpful? Give feedback.
-
So, I pushed a couple of quick fixes and everything is fine. You should really read more about the tools you are using and how to use them properly. This has nothing to do with Bootstrap. |
Beta Was this translation helpful? Give feedback.
So, I pushed a couple of quick fixes and everything is fine. You should really read more about the tools you are using and how to use them properly. This has nothing to do with Bootstrap.