CSS duplicate - is this a bug?

When I download components from online and then drop into page, the css styles shows stylesheet.css and stylesheet1.css

I have used stylesheet as an example name but why is this happening? it creates another version of the stylesheet, naming it 1? is this a bug or an issue with the coding of the component/css?

I notice this only happens for user created components, if I download any of the bootstrapstudio created components (from online) there is only one stylesheet.

I believe that is a failsafe to make sure it doesn't edit your own CSS file. Keeping in mind that you're getting things from other users, and as much as we'd love to trust every person that submits things, I'm sure we've all had bad experiences where someone else's code messed up our files. The way it's setup in here is pretty good protection to make sure your own files don't get corrupted with bad code, and also gives you the opportunity to be sure you aren't getting duplicate css elements in your code.

I've found that the CSS cleans up very nicely when you use the Styles window of the code area which shows you all code from all files. This way if there are duplicates you can clean them out leaving you only those that are not duplicated tags. Frees you to then transfer those to your main custom file or leave them as is, whatever works best for you.

When you do your own Custom components (meaning you share some with others in the Online tab), you have a choice to take the CSS or Scripts or not to. This way if it's something you want to transfer from one project to another you can create the Component and insert it without having to pull the CSS and JS if you don't need it.

Lots of ways to implement all of this, but truly, as tedious as it gets to edit the CSS files to clean up the excess, I actually like it this way so my files are safe from other's possible corrupted classes and overwriting of my own.

Just my thoughts on what it's doing of course :)

Hi Jo,

Thanks for the reply! I found it odd as it only occurred with custom components and yes you make a good point re other users code and that is why I no longer use other peoples components (no offence to anyone) but I build my own blocks, better to know what you're working with!

I also had another issue, say I created a page made up of 7 of my custom components and each component had section tags, at the end of every section bootstrap studio (after exporting file) inserts reference to bootstrap mini and js...after every section!....so not only do I have to tidy up the duplicate css, also tidy up the unneeded code.

So yes, not the end of the world and only takes 5 minutes but would be nice if the export was cleaner, just because there is no need for the extra css or reference to bootstrap mini after every section.

Cheers

Hiya Smart,

Hmm, check your code and see if it's referencing the JS in the custom code. If it is remove it from there and that should fix the issue with the js showing up after every section as that shouldn't happen. Don't think I've ever seen that happen now that I think about it unless it was referenced in the code that way so check your code and see if it is.

As for the custom components by others, I've tried some here and there, use some on some sites, and some work and some don't (most likely due to my lack of knowing how to use them I'm guessing lol), but it's fun to check them out. One way to do that is to create a bogus project just to play with the components. I have to admit I've learned a lot about this app as well as the components by doing that. :)

Ok Jo, cheers- possibly my fault! ...actually it definitely is lol

I've been busy creating custom components but have been creating them outside of bootstrap studio and then importing them as backup in the user library, but of course if the custom code has reference to the bootstrap mini / js then when I import bootstrap studio will just read that code.

So thanks for clearing both issues up Jo.

As for the custom components by others, I’ve tried some here and there, use some on some sites, and some work and some don’t (most likely due to my lack of knowing how to use them I’m guessing lol), but it’s fun to check them out. One way to do that is to create a bogus project just to play with the components. I have to admit I’ve learned a lot about this app as well as the components by doing that.

What I actually done when first learning about bootstrap was I visited bootstrap snippets http://bootsnipp.com/ - download a ton of snippets, imported into bootstrap studio but quickly realised i'm not going to learn much this way, plus I found the way some coded the blocks caused problems so I deleted all the components and instead build my own blocks and focus on keeping them as simple as possible, instead of bloated code.

Glad you got it all worked out Smart, and whatever works for you for the components is all that counts. :)

Jo, theres method in my madness - honest!