-
Notifications
You must be signed in to change notification settings - Fork 27
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
Adding css overrides. #4
Comments
well you can add styles post bootstrap like you normally would. Just beware the load order of meteor. I recommended putting bootstrap into the lib folder which means it has a higher priority. However putting a folder into that lib folder will have an even higher priority. Have you tried a setup like this?:
Now that I think about it, It might not be as smart to put bootstrap into the lib folder. I may change the readme to something like
|
I have other less files that I need to append after the bootstrap file. How about just making an option to make the generated custom.bootstrap.less into an importable file, so I can say do:
Right now I have my styles.less outside of the lib folder, however I get errors because I need some of the bootstrap mixins which are not available. Previously I was including the bootstrap less file first (like in my example), and then my own component files and that worked perfectly. |
the bootstrap mixins and variables are available though |
I have done that, however the generated bootstrap css file overwrites my custom one. I think the issue is that the generated bootstrap css file overwrites everything, so I lose the colors and all overriding bootstrap styles. I've tried all the permutations. I can fork your repo and apply fix it myself if you don't feel like changing what you have. |
then move bootstrap so that it loads before your styles or move your styles so that they load after bootstrap. Or am i missing something? |
I get what you are getting at, and I have tried them already. It always ends up the bootstrap generated css overriding mine. |
what is your setup right now? |
My current setup:
In my styles.less
|
Seems about right. I'd recommend using Then try this: remove or rename the json file and rename |
Works perfect if I try your second suggestion, which is what I was saying all along :) If this is the recommended solution then I can stick with it. But it seems less than ideal since I'm 'hacking' around your package. Thanks. Edit: Bootstrap components no longer work, e.g. dropdowns. |
it wasn't a solution, i try to understand what the problem is. I have a project where I overwrite styles too and it works. I have a feeling that the |
My styles are still being overwritten. May I ask how your styles are structured if it's working for you? |
I use the file structure of meteor-em with bootstrap placed in The loading order seems to be this:
So I have no idea how that is ordered. This may be a case for a meteor issue. I'll investigate that further when I have time again. |
From the meteor documentation, it is desired behavior for the bootstrap less file to be in the lib, as that should get loaded first. From there, we would want to override the default bootstrap styles with our own modifications, and thus we should have the styles in a parent directory. However, it is not clear whether meteor treats less files as css files, it does say it gets generated into css first, but it is unclear if they are stored in the same directories as their less counterparts. |
If that can be of any help, I was experiencing this same issue because I was importing My folders layout is the following:
and my screen.less is like this:
I don't know if it's a random thing and Meteor got the loading order right just by chance. But this is working fine for me. |
beware that if you import But it's a good hint that it may has to do with importing stuff, as I tried to recreate the problem but failed until now. |
I just started looking at this after having based my bootstrap with less usage on this post from Manuel Schoebel. And then I came across this minimalist approach which I find very compelling. By simply putting the bootstrap 3 distribution into the public folder, renaming bootstrap.less to bootstrap.import.less and then creating your own styles.less file that starts with @import /bootstrap.import.less you get all the override capability. The only downside is that it does not let you easily customize what is included/excluded from the bootstrap download. However, you could always simply remove files directly from the /public folder for items that you don't want to include. Perhaps I'm missing something, but I find this approach to be very appealing and removes the reliance on any packages as you can do it all "by hand." The package landscape has been particularly challenging of late and I'm looking for ways to reduce reliance on packages when I can. I'd welcome thoughts from others on this. Thanks for listening. UPDATE: I failed to mention that all of the less files in the less dir would need to be renamed as .import.less and that all of the @import statements in the bootstrap.import.less would have be changed to reflect all of the .import.less filenames. I still find this rather straightforward. UPDATE2: It also appears to work if you put the bootstrap files in the /private directory. If you are concerned about the bootstrap files being available via url. In either case, the files remain on the server and are used to compile the ultimate css that gets sent to the client. |
I have tried the many different directory schemes and was not able to successfully override the resulting generated file. I ended up just taking the outputted |
Anyone figure out a more streamlined way to include LESS theme-files, without renaming autogenerated files etc? |
I have been hacking around on this as well in Patterned off @pbeets solution, this version generates My @import 'boostrap/bootstrap.import.less';
//... other CSS here |
Hi, I'd recommend to include this option into this package. E.g. "generate-import-file": false (as default). |
Just in case this wasn't obvious to anyone else, after you rename the custom.bootstrap.json file, the JS files will no longer be available to the client. To add back the bootstrap.min.js via CDN, you can use viacdn:bootstrapjs. 35KB file, might as well take advantage of caching if available. |
I don't have any trouble overriding the bootstrap styles with my theme's css or with my custom less. my file order looks like this |
I'll add to this because it's still open, I found it via google (as will others), and I had some luck figuring it out and I think I understand the why of it. I think it would help to review this load order documentation:
Meteor loads files in a fairly simple and predictable way. If you want the custom* files to load before your overrides, just follow the rules above. A subdirectory of the directory your overrides are in will work, as suggested above. Other things will work as well. |
how I make it, when I will use bootstrap via CDN? or font-awesomem or jquery or angular, or anything... animate.css... etc |
This package is fantastic. However, with the current setup, you cannot add styles post-bootstrap. For instance overrides and additional styles cannot be included because bootstrap is included at the end and takes precedence. I'm using some themes from bootswatch.com and this can only be used by overriding the default bootstrap styles.
The text was updated successfully, but these errors were encountered: