[GH-ISSUE #1045] define-color does not support hexcodes with alpha #328

Closed
opened 2026-05-22 21:52:38 +01:00 by JakeStanger · 2 comments
Owner

Originally created by @0PandaDEV on GitHub (Jun 13, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1045

Describe the bug
When setting a color using define-color to a hex code that includes an alpha like #ffffff0d it throws an error that a semicolon is missing.

To reproduce
Steps to reproduce the behavior:

  1. Add @define-color border #ffffff0d; to the style.css
  2. Reload and check the logs.
2025-06-13T14:44:14.786116Z ERROR ironbar::style: 79:
   0: Failed to load CSS
   1: style.css:4:28Missing semicolon at end of color definition

Location:
   src/style.rs:79

Suggestion: Check the CSS file for errors
Suggestion: GTK CSS uses a subset of the full CSS spec and many properties are not available. Ensure you are not using any unsupported property.

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Originally created by @0PandaDEV on GitHub (Jun 13, 2025). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1045 **Describe the bug** When setting a color using define-color to a hex code that includes an alpha like #ffffff0d it throws an error that a semicolon is missing. **To reproduce** Steps to reproduce the behavior: 1. Add @define-color border #ffffff0d; to the style.css 2. Reload and check the logs. ```bash 2025-06-13T14:44:14.786116Z ERROR ironbar::style: 79: 0: Failed to load CSS 1: style.css:4:28Missing semicolon at end of color definition Location: src/style.rs:79 Suggestion: Check the CSS file for errors Suggestion: GTK CSS uses a subset of the full CSS spec and many properties are not available. Ensure you are not using any unsupported property. Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. ```
JakeStanger 2026-05-22 21:52:38 +01:00
Author
Owner

@pgattic commented on GitHub (Jun 13, 2025):

I don't know if the devs would do much about this, since it is more of an issue for GTK's CSS specification. The CSS you write for your bar is just fed to GTK for parsing and application.

If you want to have transparency, you can use an rgba value instead. An exact equivalent in your case would be @define-color border rgba(255, 255, 255, 0.05078125);

GTK's flavor of CSS is a subset of the one HTML5 does. Read about it here: https://docs.gtk.org/gtk3/css-properties.html

<!-- gh-comment-id:2970724668 --> @pgattic commented on GitHub (Jun 13, 2025): I don't know if the devs would do much about this, since it is more of an issue for GTK's CSS specification. The CSS you write for your bar is just fed to GTK for parsing and application. If you want to have transparency, you can use an `rgba` value instead. An exact equivalent in your case would be `@define-color border rgba(255, 255, 255, 0.05078125);` GTK's flavor of CSS is a subset of the one HTML5 does. Read about it here: https://docs.gtk.org/gtk3/css-properties.html
Author
Owner

@JakeStanger commented on GitHub (Jun 13, 2025):

Yep unfortunately we're stuck with what GTK 3 offers.

GTK 4 has a wider CSS spec, which I believe includes better alpha support, so you might have better luck with the port.

<!-- gh-comment-id:2970761530 --> @JakeStanger commented on GitHub (Jun 13, 2025): Yep unfortunately we're stuck with what GTK 3 offers. GTK 4 has a wider CSS spec, which I believe includes better alpha support, so you might have better luck with the port.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#328
No description provided.