Skip to content

[chores] Use theme color variables instead of hardcoded values #661#701

Merged
nemesifier merged 2 commits intoopenwisp:masterfrom
shivsubh:issues/661-use-theme-color-variables
Apr 21, 2026
Merged

[chores] Use theme color variables instead of hardcoded values #661#701
nemesifier merged 2 commits intoopenwisp:masterfrom
shivsubh:issues/661-use-theme-color-variables

Conversation

@shivsubh
Copy link
Copy Markdown
Contributor

@shivsubh shivsubh commented Apr 6, 2026

Replace hardcoded colors in CSS files and templates with the CSS variables introduced in openwisp-utils#516 to ensure unified theming and simplify future palette updates.

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #661 .

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f06ad143-5c82-463b-b80d-ade99a201c02

📥 Commits

Reviewing files that changed from the base of the PR and between 73f7098 and 0ee91e8.

📒 Files selected for processing (3)
  • openwisp_radius/integrations/monitoring/static/radius-monitoring/css/device-change.css
  • openwisp_radius/static/openwisp-radius/css/mode-switcher.css
  • openwisp_radius/static/openwisp-radius/css/radiusbatch.css
💤 Files with no reviewable changes (2)
  • openwisp_radius/static/openwisp-radius/css/mode-switcher.css
  • openwisp_radius/static/openwisp-radius/css/radiusbatch.css
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.10 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=4.2.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Kilo Code Review
🔇 Additional comments (1)
openwisp_radius/integrations/monitoring/static/radius-monitoring/css/device-change.css (1)

13-13: Good theming alignment on Line 13.

Using var(--ow-color-success) instead of a hardcoded color is the right direction and matches the centralized palette objective.


📝 Walkthrough

Walkthrough

This pull request refactors CSS color styling across three files to align with the OpenWISP theme variables initiative. The changes replace hardcoded color values with CSS custom properties from openwisp-utils: color: green is replaced with color: var(--ow-color-success) in device-change.css, while hardcoded color: #333 and `color: `#000 declarations are removed from mode-switcher.css and radiusbatch.css respectively, relying on cascading styles instead. This ensures consistent theming through centralized variable management.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format [type] with 'chores' type and clearly describes replacing hardcoded colors with theme variables, directly addressing issue #661.
Description check ✅ Passed The description includes the required template sections with filled content, clear objective explanation, and issue reference, though manual testing and test/documentation updates are incomplete.
Linked Issues check ✅ Passed The PR successfully replaces hardcoded color values with CSS theme variables across three CSS files, directly implementing the core coding requirement from issue #661.
Out of Scope Changes check ✅ Passed All changes in the PR are directly scoped to issue #661 objectives: replacing hardcoded colors with CSS theme variables in style files.
Bug Fixes ✅ Passed This PR refactors hardcoded CSS values to use theme variables, which is a chore/refactoring effort not fixing core user-facing bugs, making the Bug Fixes check inapplicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 6, 2026
@shivsubh shivsubh force-pushed the issues/661-use-theme-color-variables branch from 7b03dbb to 73f7098 Compare April 6, 2026 06:08
…sp#661

Refactor hardcoded color values in CSS files and templates to use the CSS variables introduced in openwisp-utils#516.

Closes openwisp#661
@shivsubh shivsubh force-pushed the issues/661-use-theme-color-variables branch from 73f7098 to 02cee4a Compare April 6, 2026 06:14
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 6, 2026

Coverage Status

coverage: 97.46%. remained the same — shivsubh:issues/661-use-theme-color-variables into openwisp:master

@nemesifier nemesifier changed the title [chore]: Use theme color variables instead of hardcoded values #661 [chores] Use theme color variables instead of hardcoded values #661 Apr 21, 2026
.form-row.field-username label {
font-weight: bold;
color: #333;
color: var(--ow-color-fg-darker, #333);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed

.field-number_of_users label {
font-weight: bold;
color: #000;
color: var(--ow-color-black, #000);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed

table th { font-weight: bold }
table th, table td {
border: 1px solid #ccc;
border: 1px solid var(--ow-color-fg-medium, #ccc);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the var won't work here, this is used only for PDF generation

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Apr 21, 2026

Code Review Summary

Status: No Critical Issues Found | Recommendation: Address existing maintainer comments, then merge

The PR successfully replaces hardcoded colors with CSS theme variables as intended. The changes are clean and focused on issue #661.

Changes Reviewed

File Change Status
device-change.css greenvar(--ow-color-success) ✅ Valid CSS variable usage
mode-switcher.css Removed hardcoded #333 color ✅ Addressed per maintainer comment
radiusbatch.css Removed hardcoded #000 color ✅ Addressed per maintainer comment
prefix_pdf.html Kept #ccc (reverted CSS var) ✅ Correct - PDF generation doesn't support CSS vars

Existing Maintainer Comments

@nemesifier has already provided review feedback on 3 items which appear to have been addressed in the latest commit:

  1. mode-switcher.css - Remove color property entirely (not just replace with var)
  2. radiusbatch.css - Remove color property entirely (not just replace with var)
  3. prefix_pdf.html - Keep hardcoded color since CSS variables don't work in PDF generation context

Files Reviewed (4 files)

  • openwisp_radius/integrations/monitoring/static/radius-monitoring/css/device-change.css
  • openwisp_radius/static/openwisp-radius/css/mode-switcher.css
  • openwisp_radius/static/openwisp-radius/css/radiusbatch.css
  • openwisp_radius/templates/openwisp-radius/prefix_pdf.html

Note: This review focused on critical bugs and security issues only. No blocking issues found.


Reviewed by kimi-k2.5-0127 · 96,135 tokens

@nemesifier nemesifier merged commit ea06c50 into openwisp:master Apr 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chores] Use theme colors from openwisp-utils variables

3 participants