Skip to content
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

exclude bootstrap is not working correctly #4832

Closed
Jimmi08 opened this issue Jul 29, 2022 · 2 comments
Closed

exclude bootstrap is not working correctly #4832

Jimmi08 opened this issue Jul 29, 2022 · 2 comments
Labels
topic: documentation type: bug A problem that should not be happening

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Jul 29, 2022

Bug Description

This settings:

 	<libraries>
		<library name="bootstrap" version="5" scope="front"/>
	</libraries>
	<stylesheets>
        <css file="default.css" name="Default"   scope='front' exclude="bootstrap"/>
	</stylesheets>  

is loading CDN bootstrap library

<link rel="stylesheet" media="all" property="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" />

How to Reproduce

Core bootstrap5 theme is working because using word bootstrap in stylesheets.

This works too:

	<stylesheets>
	    <css file="bootstrap.min.css" name="Legacy"   scope='front' exclude='bootstrap' />
        <css file="default.css" name="Default"   scope='front' exclude="bootstrap"/>
	</stylesheets>   

This is not working:

	<stylesheets>
        <css file="blue.css" name="Default"   scope='front' exclude="bootstrap"/>
        <css file="red.css" name="Default"   scope='front' exclude="bootstrap"/>
	</stylesheets>  

This works:

	<stylesheets>
        <css file="bootstrap.blue.css" name="Default"   scope='front' exclude="bootstrap"/>
        <css file="bootstrap.red.css" name="Default"   scope='front' exclude="bootstrap"/>
	</stylesheets> 

By the way, with one style in xml, style.css is always set as themecss pref, so this doesn't work either:

	<stylesheets>
        <css file="bootstrap.default.css" name="Default"   scope='front' exclude="bootstrap"/>
	</stylesheets>  

Expected Behavior

Not loading bootstrap css from core

PHP

PHP 8.1

Thanks

Workaround:

	<stylesheets>
        <css file="assets/css/bootstrap.min.css" name="Don't use this"  scope='front' exclude="bootstrap"/>
        <css file="default.css" name="Default 2" default='true'  scope='front' exclude="bootstrap"/>
	</stylesheets>   

@Jimmi08 Jimmi08 added the type: bug A problem that should not be happening label Jul 29, 2022
@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Dec 4, 2022

@CaMer0n
Is it mandatory to use word "bootstrap" in style name to exclude core bootstrap or this is bug?
This is really important.
Thank you.

@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Dec 5, 2022

This is working solution to not load core bootstrap css on frontend, but still have BOOSTRAP defined.
No exclude in stylesheet is needed.

    <libraries>
        <library name="bootstrap"
            version="5"
            scope="wysiwyg" 
            files="css" />
        <library name="bootstrap"
            version="5"
            scope="front" 
            files="js" />
        <library name="fontawesome"
            version="5"
            scope="front"
            files="js" />
        <library name="fontawesome"
            version="5"
            scope="wysiwyg"
            files="css" />
    </libraries>

example for stylesheet:

    <stylesheets>
        <css file="main.css"
            name="Main css compiled with bootstrap"
            default='true'
            scope='front'
             />
        <css file="assets/css/lineicons.min.css"
            name="Default"
            scope='wysiwyg' />
    </stylesheets>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation type: bug A problem that should not be happening
Projects
Status: Backlog
Development

No branches or pull requests

2 participants