Bug: Invalid CSS syntax generated for topbar border (rgb wrapping oklch) #31
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pxlrbt/filament-environment-indicator#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Laravel: 12.38.1
Filament: 4.2.1
pxlrbt/filament-environment-indicator: 3.3.0
PHP: 8.3.20
Description
I encountered a CSS syntax error when the environment indicator renders the top bar. The plugin currently forces an rgb() wrapper around the color value. However, Filament is returning a full oklch(...) string, resulting in nested color functions that browsers cannot parse.
Analysis
Upon inspecting the .fi-topbar element in the browser dev tools, the computed style renders as:
Root Cause
I located the issue in src/EnvironmentIndicatorPlugin.php on line 121. The code explicitly adds rgb(...) around the return value of getColor()['500']. Since modern Filament versions/themes return the color as a complete oklch string, the wrapper is invalid.
Suggested Fix
The rgb() wrapper and parentheses should be removed to allow the color string (whether it is oklch, hex, or rgb) to render naturally.
File: src/EnvironmentIndicatorPlugin.php
Current Code (Line 121):
Proposed Fix:
NVM i just saw the update