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

Not all CSS is scoped when using 'scoped mode' to avoid conflicts in large project code bases #4964

Open
acsm960 opened this issue Feb 2, 2024 · 0 comments
Labels
! Bug Something which isn't working as expected

Comments

@acsm960
Copy link

acsm960 commented Feb 2, 2024

UIkit Version

3.18.0

Actual Behavior

I am applying UIkit within a large wordpress theme with other CSS files. When I went to run the 'scope mode' some of my h2 tags were being changed by UIkit from serif fonts to san serif fonts.

I discovered this was because the scoped output CSS file prefixes all HTML tags with .uikit except for HTML, which contained a "font-family" property

Screen Shot 2024-02-02 at 11 00 36 am

Solution

Though not very elegant, I was able to replace the first line of the CSS file from
html to .uk-scope

Screen Shot 2024-02-02 at 11 00 50 am

I think it would also be ok to just note this in the docs.

Expected Behavior

The CSS should have only changed content within the scoped div.

 <div class="uk-scope">
            <!-- your UIkit markup -->
            …
        </div>
@acsm960 acsm960 added the ! Bug Something which isn't working as expected label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
! Bug Something which isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant