admin管理员组文章数量:1026989
I'm writing a simple WordPress plugin that uses some shortcodes to show content on public side of the side. These shortcodes use some Bootstrap's components like buttons, input groups and popovers but the CSS of the selected theme interferes with Bootstrap CSS and rendering is not optimal... How can use "pure" Bootstrap CSS just for my shortcodes making them independent of the selected WordPress theme?
I read this possible solution but now Bootstrap no longer uses LESS but SASS and I tried to compile .scss file but some components doesn't work, like tooltips, and some CSS is wrong, like font-family.
I'm writing a simple WordPress plugin that uses some shortcodes to show content on public side of the side. These shortcodes use some Bootstrap's components like buttons, input groups and popovers but the CSS of the selected theme interferes with Bootstrap CSS and rendering is not optimal... How can use "pure" Bootstrap CSS just for my shortcodes making them independent of the selected WordPress theme?
I read this possible solution but now Bootstrap no longer uses LESS but SASS and I tried to compile .scss file but some components doesn't work, like tooltips, and some CSS is wrong, like font-family.
Share Improve this question asked Nov 18, 2019 at 17:49 icolumbroicolumbro 791 silver badge9 bronze badges 2- The answer is still just as valid. Them switching from less to sass changes nothing in that context, you just need to fix your build pipeline – kero Commented Nov 18, 2019 at 17:56
- I followed this more recent discussion almost work but tooltips and I can't understand why... How jQuery can be affected by this customization? – icolumbro Commented Nov 18, 2019 at 18:09
1 Answer
Reset to default 1Ok, I think I solved: followed this discussion so I imported Bootstrap SASS file in a new SASS file creating a custom class as container to isolate Bootstrap components and compiled the custom .scss to .css. Fixed html and body selector in new CSS file and to have working tooltips I did:
$('[data-toggle="tooltip"]').tooltip({
container: '.custom-container', //needed to have working tooltips
html: true,
});
I'm writing a simple WordPress plugin that uses some shortcodes to show content on public side of the side. These shortcodes use some Bootstrap's components like buttons, input groups and popovers but the CSS of the selected theme interferes with Bootstrap CSS and rendering is not optimal... How can use "pure" Bootstrap CSS just for my shortcodes making them independent of the selected WordPress theme?
I read this possible solution but now Bootstrap no longer uses LESS but SASS and I tried to compile .scss file but some components doesn't work, like tooltips, and some CSS is wrong, like font-family.
I'm writing a simple WordPress plugin that uses some shortcodes to show content on public side of the side. These shortcodes use some Bootstrap's components like buttons, input groups and popovers but the CSS of the selected theme interferes with Bootstrap CSS and rendering is not optimal... How can use "pure" Bootstrap CSS just for my shortcodes making them independent of the selected WordPress theme?
I read this possible solution but now Bootstrap no longer uses LESS but SASS and I tried to compile .scss file but some components doesn't work, like tooltips, and some CSS is wrong, like font-family.
Share Improve this question asked Nov 18, 2019 at 17:49 icolumbroicolumbro 791 silver badge9 bronze badges 2- The answer is still just as valid. Them switching from less to sass changes nothing in that context, you just need to fix your build pipeline – kero Commented Nov 18, 2019 at 17:56
- I followed this more recent discussion almost work but tooltips and I can't understand why... How jQuery can be affected by this customization? – icolumbro Commented Nov 18, 2019 at 18:09
1 Answer
Reset to default 1Ok, I think I solved: followed this discussion so I imported Bootstrap SASS file in a new SASS file creating a custom class as container to isolate Bootstrap components and compiled the custom .scss to .css. Fixed html and body selector in new CSS file and to have working tooltips I did:
$('[data-toggle="tooltip"]').tooltip({
container: '.custom-container', //needed to have working tooltips
html: true,
});
本文标签: Make shortcode39s Bootstrap CSS override the theme39s CSShow
版权声明:本文标题:Make shortcode's Bootstrap CSS override the theme's CSS, how? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1744993313a2128421.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论