Broken CSS after updating from 2.24.2 to 3.0.2 #5211
-
First Check
Example Codenotification_defaults = {
'timeout': 500,
'group': True,
'badgeClass': "Essa"
}
global notification_default
notification_default = functools.partial(ui.notification, **notification_defaults)
ui.add_head_html("""
.bg-positive, .bg-negative, .bg-info, .bg-warning { border-radius: 25px !important; background: transparent !important; backdrop-filter: blur(15px) !important;}
.bg-positive { border: 2px solid #21ba45 !important; box-shadow: 0px 3px 15px 0px #21ba45; }
.bg-positive .q-notification__content { color: #21ba45 !important; }
.bg-negative { border: 2px solid #FF4D4F !important; box-shadow: 0px 3px 15px 0px #FF4D4F; }
.bg-negative .q-notification__content { color: #FF4D4F !important; }
.bg-info { border: 2px solid #31ccec !important; box-shadow: 0px 3px 15px 0px #31ccec; }
.bg-info .q-notification__content { color: #31ccec !important; }
.bg-warning { border: 2px solid #f2c037 !important; box-shadow: 0px 3px 15px 0px #f2c037; }
.bg-warning .q-notification__content { color: #f2c037 !important; }
.q-tab__label { font-size: unset; font-weight: unset;}
.q-notification { position: sticky; overflow: hidden; }
.q-notifications__list--bottom { margin-bottom: 1.5% !important; gap: 15px; }
.q-notification::before{content:'';position:absolute;top:0;left:0;height:100%;width:0;background:#00494d95;z-index:-1;animation:progress 3.5s linear forwards;border-radius:23px}
.q-notification__badge{padding: 0px !important;}
""")
ui.button('Odśwież Listę', on_click=[notification_default("Nie wykryto okien Minecrafta", type="warning").props('progress')]).classes("w-48 text-lg rounded-[35px]").props("no-caps color=primary unelevated outline ") DescriptionHi! I recently updated Quasar from version 2.24.2 to 3.0.2 and encountered a problem with CSS malfunctioning. Specifically, for some elements for which I had custom CSS styles, the built-in classes of the Quasar framework now override my custom rules, which was not the case before. Here is an example illustrating this issue: NiceGUI Version3.0.2 Python VersionPython 3.13.7 BrowserEdge Operating SystemWindows Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hello @Kowersky It's you again, I know you from your extensive styling of NiceGUI. High-level speaking, in 3.0 we use CSS layers, and in #5171 our intention is to fully leverage CSS layering to put Quasar's !important styles into less powerful CSS layer, such that user already have power over Quasar. But in your code I think this is an expected collateral breaking change in 3.0, and it should not be unfixable, but will require user code changes. Still, we may try and work on better documentation. When I have time let me try and work things out, but right now I'm unavailable. |
Beta Was this translation helpful? Give feedback.
-
Luckily the fix is rather simple. Just move your Quasar CSS into the new "quasar" layer: ui.add_css('''
@layer quasar {
.bg-positive, .bg-negative, .bg-info, .bg-warning { border-radius: 25px !important; background: transparent !important; backdrop-filter: blur(15px) !important;}
.bg-positive { border: 2px solid #21ba45 !important; box-shadow: 0px 3px 15px 0px #21ba45; }
.bg-positive .q-notification__content { color: #21ba45 !important; }
.bg-negative { border: 2px solid #FF4D4F !important; box-shadow: 0px 3px 15px 0px #FF4D4F; }
.bg-negative .q-notification__content { color: #FF4D4F !important; }
.bg-info { border: 2px solid #31ccec !important; box-shadow: 0px 3px 15px 0px #31ccec; }
.bg-info .q-notification__content { color: #31ccec !important; }
.bg-warning { border: 2px solid #f2c037 !important; box-shadow: 0px 3px 15px 0px #f2c037; }
.bg-warning .q-notification__content { color: #f2c037 !important; }
.q-tab__label { font-size: unset; font-weight: unset;}
.q-notification { position: sticky; overflow: hidden; }
.q-notifications__list--bottom { margin-bottom: 1.5% !important; gap: 15px; }
.q-notification::before{content:'';position:absolute;top:0;left:0;height:100%;width:0;background:#00494d95;z-index:-1;animation:progress 3.5s linear forwards;border-radius:23px}
.q-notification__badge{padding: 0px !important;}
}
''')
ui.button('Notify', on_click=lambda: ui.notify('Nie wykryto okien Minecrafta', type='warning')) |
Beta Was this translation helpful? Give feedback.
Luckily the fix is rather simple. Just move your Quasar CSS into the new "quasar" layer: