Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
rbecher
Partner - Master III
Partner - Master III

Extension with bootstrap.js/.css issues

Hi all,

I use bootstrap in an extension but it creates a lot of layout issues if I switch into edit mode. Labels disappear or get smaller:

bootstrap1.PNGbootstrap2.PNG

Any idea? I think this is some AngularJS/bootstrap intolerance..

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
1 Solution

Accepted Solutions
Stefan_Walther
Employee
Employee

Hi Ralf,

that's a tricky one, but solved it in some extensions.

The best way I have come up with is to "scope" the Bootstrap CSS to only the CSS namespace of your extensions, so that all classes only work within the CSS-class of your extension. So you have to re-create the Bootstrap CSS ...

It would also work with .class:scope (:scope - CSS | MDN) but unfortunately this is not widely supported yet, actually only Firefox (http://caniuse.com/#search=scope)

Another way I am using in smaller extensions is just to create a subset of the needed classes, buttons, etc. for usage in my extension. The full Bootstrap CSS is overkill anyhow since some concepts (e.g. Grid-system) conflicts with the CSS-concept of Qlik Sense.

Hmm, let's see if I can add an example to my qsExtensionPlayground

Hope this helps a bit.

Regards

Stefan

View solution in original post

6 Replies
Stefan_Walther
Employee
Employee

Hi Ralf,

that's a tricky one, but solved it in some extensions.

The best way I have come up with is to "scope" the Bootstrap CSS to only the CSS namespace of your extensions, so that all classes only work within the CSS-class of your extension. So you have to re-create the Bootstrap CSS ...

It would also work with .class:scope (:scope - CSS | MDN) but unfortunately this is not widely supported yet, actually only Firefox (http://caniuse.com/#search=scope)

Another way I am using in smaller extensions is just to create a subset of the needed classes, buttons, etc. for usage in my extension. The full Bootstrap CSS is overkill anyhow since some concepts (e.g. Grid-system) conflicts with the CSS-concept of Qlik Sense.

Hmm, let's see if I can add an example to my qsExtensionPlayground

Hope this helps a bit.

Regards

Stefan

rbecher
Partner - Master III
Partner - Master III
Author

Hi Stefan,

thanks for your advice! I followed your hint to create a subset of the needed classes. But this is real hard work since it is not very obvious what to keep ...

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
Stefan_Walther
Employee
Employee

rbecher
Partner - Master III
Partner - Master III
Author

Well, yours is the professional solution. I will try this later but need to get into the topic a bit more.

At the moment, I did a raw hack of the bootstrap.css file where I deleted all except what I (guessed) is needed for my extension.. 😉

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
rbecher
Partner - Master III
Partner - Master III
Author

Btw. why not posting the file scoped-bootstrap.css itself here or in Branch?

Best regards,

Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
Stefan_Walther
Employee
Employee