Class: IronAdmin::Configuration::Theme
- Inherits:
-
Object
- Object
- IronAdmin::Configuration::Theme
- Defined in:
- lib/iron_admin/configuration/theme.rb
Overview
Theme configuration for customizing the admin panel appearance.
All theme properties accept Tailwind CSS class strings. This allows complete customization of colors, spacing, and visual styles.
Button Styles collapse
-
#btn_danger ⇒ String
Danger/destructive button classes (default: red).
-
#btn_ghost ⇒ String
Ghost button classes (default: gray background).
-
#btn_primary ⇒ String
Primary button classes (default: indigo).
-
#btn_secondary ⇒ String
Secondary button classes (default: white with border).
Link Styles collapse
-
#link ⇒ String
Primary link classes.
-
#link_muted ⇒ String
Muted/secondary link classes.
Form Styles collapse
-
#checkbox_checked ⇒ String
Checked checkbox classes.
-
#focus_ring ⇒ String
Focus ring classes for interactive elements.
-
#input_border ⇒ String
Input border classes.
-
#input_focus ⇒ String
Input focus state classes.
Tab/Scope Styles collapse
-
#badge_count ⇒ String
Badge counter classes.
-
#scope_active ⇒ String
Active scope/tab classes.
-
#scope_inactive ⇒ String
Inactive scope/tab classes.
Sidebar Styles collapse
-
#sidebar_bg ⇒ String
Sidebar background classes.
-
#sidebar_group_label ⇒ String
Sidebar group label classes.
-
#sidebar_link ⇒ String
Sidebar link classes.
-
#sidebar_link_hover ⇒ String
Sidebar link hover classes.
-
#sidebar_title ⇒ String
Sidebar title text classes.
Navbar Styles collapse
-
#navbar_bg ⇒ String
Navbar background classes.
-
#navbar_border ⇒ String
Navbar border classes.
-
#navbar_search_bg ⇒ String
Navbar search input background.
-
#navbar_search_focus_bg ⇒ String
Navbar search input focus background.
Table Styles collapse
-
#table_border ⇒ String
Table border/divider classes.
-
#table_header_bg ⇒ String
Table header background classes.
-
#table_row_hover ⇒ String
Table row hover classes.
Card Styles collapse
-
#card_bg ⇒ String
Card background classes.
-
#card_border ⇒ String
Card border classes.
-
#card_shadow ⇒ String
Card shadow classes.
Typography collapse
-
#body_text ⇒ String
Body text color classes.
-
#font_family ⇒ String
Font family classes (empty = system default).
-
#heading_weight ⇒ String
Heading weight classes.
-
#label_text ⇒ String
Label text color classes.
-
#muted_text ⇒ String
Muted text color classes.
Layout collapse
-
#border_radius ⇒ String
Border radius classes.
-
#main_bg ⇒ String
Main content area background classes.
Chart Styles collapse
-
#chart_border_color ⇒ String
Default chart border/line color (CSS color value).
-
#chart_colors ⇒ Array<String>
Default chart color palette (CSS color values: hex, rgb, rgba).
Instance Method Summary collapse
-
#initialize ⇒ Theme
constructor
Creates a new Theme with default values.
Constructor Details
#initialize ⇒ Theme
Creates a new Theme with default values.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/iron_admin/configuration/theme.rb', line 177 def initialize # --- Buttons --- @btn_primary = "bg-indigo-600 text-white hover:bg-indigo-700 focus:ring-2 focus:ring-indigo-500/20 focus:ring-offset-1" @btn_secondary = "bg-white text-gray-700 border border-gray-300 hover:bg-gray-50 hover:border-gray-400" @btn_danger = "bg-red-600 text-white hover:bg-red-700" @btn_ghost = "bg-gray-100 text-gray-700 hover:bg-gray-200" # --- Links --- @link = "text-indigo-600 hover:text-indigo-900" @link_muted = "text-gray-500 hover:text-gray-700" # --- Focus ring --- @focus_ring = "focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20" # --- Inputs --- @input_border = "border-gray-300 hover:border-gray-400" @input_focus = "focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20" # --- Checkbox --- @checkbox_checked = "checked:border-indigo-600 checked:bg-indigo-600 focus:ring-2 focus:ring-indigo-500/20" # --- Scopes / Tabs --- @scope_active = "border-indigo-600 text-indigo-600" @scope_inactive = "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" # --- Badge counter --- @badge_count = "bg-indigo-600 text-white" # --- Navbar --- @navbar_bg = "bg-white" @navbar_border = "border-gray-200" @navbar_search_bg = "bg-gray-50" @navbar_search_focus_bg = "focus:bg-white" # --- Table --- @table_header_bg = "bg-gray-50" @table_row_hover = "hover:bg-gray-50" @table_border = "divide-gray-200" # --- Cards / Panels --- @card_bg = "bg-white" @card_border = "border-gray-200" @card_shadow = "shadow" # --- Typography --- @font_family = "" @heading_weight = "font-bold" @body_text = "text-gray-900" @muted_text = "text-gray-500" @label_text = "text-gray-700" # --- Layout --- @main_bg = "bg-gray-50" @border_radius = "rounded-lg" init_chart_defaults end |
Instance Attribute Details
#badge_count ⇒ String
Returns Badge counter classes.
72 73 74 |
# File 'lib/iron_admin/configuration/theme.rb', line 72 def badge_count @badge_count end |
#body_text ⇒ String
Returns Body text color classes.
146 147 148 |
# File 'lib/iron_admin/configuration/theme.rb', line 146 def body_text @body_text end |
#border_radius ⇒ String
Returns Border radius classes.
162 163 164 |
# File 'lib/iron_admin/configuration/theme.rb', line 162 def border_radius @border_radius end |
#btn_danger ⇒ String
Returns Danger/destructive button classes (default: red).
30 31 32 |
# File 'lib/iron_admin/configuration/theme.rb', line 30 def btn_danger @btn_danger end |
#btn_ghost ⇒ String
Returns Ghost button classes (default: gray background).
33 34 35 |
# File 'lib/iron_admin/configuration/theme.rb', line 33 def btn_ghost @btn_ghost end |
#btn_primary ⇒ String
Returns Primary button classes (default: indigo).
24 25 26 |
# File 'lib/iron_admin/configuration/theme.rb', line 24 def btn_primary @btn_primary end |
#btn_secondary ⇒ String
Returns Secondary button classes (default: white with border).
27 28 29 |
# File 'lib/iron_admin/configuration/theme.rb', line 27 def btn_secondary @btn_secondary end |
#card_bg ⇒ String
Returns Card background classes.
127 128 129 |
# File 'lib/iron_admin/configuration/theme.rb', line 127 def card_bg @card_bg end |
#card_border ⇒ String
Returns Card border classes.
130 131 132 |
# File 'lib/iron_admin/configuration/theme.rb', line 130 def card_border @card_border end |
#card_shadow ⇒ String
Returns Card shadow classes.
133 134 135 |
# File 'lib/iron_admin/configuration/theme.rb', line 133 def card_shadow @card_shadow end |
#chart_border_color ⇒ String
Returns Default chart border/line color (CSS color value).
172 173 174 |
# File 'lib/iron_admin/configuration/theme.rb', line 172 def chart_border_color @chart_border_color end |
#chart_colors ⇒ Array<String>
Returns Default chart color palette (CSS color values: hex, rgb, rgba).
169 170 171 |
# File 'lib/iron_admin/configuration/theme.rb', line 169 def chart_colors @chart_colors end |
#checkbox_checked ⇒ String
Returns Checked checkbox classes.
59 60 61 |
# File 'lib/iron_admin/configuration/theme.rb', line 59 def checkbox_checked @checkbox_checked end |
#focus_ring ⇒ String
Returns Focus ring classes for interactive elements.
50 51 52 |
# File 'lib/iron_admin/configuration/theme.rb', line 50 def focus_ring @focus_ring end |
#font_family ⇒ String
Returns Font family classes (empty = system default).
140 141 142 |
# File 'lib/iron_admin/configuration/theme.rb', line 140 def font_family @font_family end |
#heading_weight ⇒ String
Returns Heading weight classes.
143 144 145 |
# File 'lib/iron_admin/configuration/theme.rb', line 143 def heading_weight @heading_weight end |
#input_border ⇒ String
Returns Input border classes.
53 54 55 |
# File 'lib/iron_admin/configuration/theme.rb', line 53 def input_border @input_border end |
#input_focus ⇒ String
Returns Input focus state classes.
56 57 58 |
# File 'lib/iron_admin/configuration/theme.rb', line 56 def input_focus @input_focus end |
#label_text ⇒ String
Returns Label text color classes.
152 153 154 |
# File 'lib/iron_admin/configuration/theme.rb', line 152 def label_text @label_text end |
#link ⇒ String
Returns Primary link classes.
40 41 42 |
# File 'lib/iron_admin/configuration/theme.rb', line 40 def link @link end |
#link_muted ⇒ String
Returns Muted/secondary link classes.
43 44 45 |
# File 'lib/iron_admin/configuration/theme.rb', line 43 def link_muted @link_muted end |
#main_bg ⇒ String
Returns Main content area background classes.
159 160 161 |
# File 'lib/iron_admin/configuration/theme.rb', line 159 def main_bg @main_bg end |
#muted_text ⇒ String
Returns Muted text color classes.
149 150 151 |
# File 'lib/iron_admin/configuration/theme.rb', line 149 def muted_text @muted_text end |
#navbar_bg ⇒ String
Returns Navbar background classes.
98 99 100 |
# File 'lib/iron_admin/configuration/theme.rb', line 98 def @navbar_bg end |
#navbar_border ⇒ String
Returns Navbar border classes.
101 102 103 |
# File 'lib/iron_admin/configuration/theme.rb', line 101 def @navbar_border end |
#navbar_search_bg ⇒ String
Returns Navbar search input background.
104 105 106 |
# File 'lib/iron_admin/configuration/theme.rb', line 104 def @navbar_search_bg end |
#navbar_search_focus_bg ⇒ String
Returns Navbar search input focus background.
107 108 109 |
# File 'lib/iron_admin/configuration/theme.rb', line 107 def @navbar_search_focus_bg end |
#scope_active ⇒ String
Returns Active scope/tab classes.
66 67 68 |
# File 'lib/iron_admin/configuration/theme.rb', line 66 def scope_active @scope_active end |
#scope_inactive ⇒ String
Returns Inactive scope/tab classes.
69 70 71 |
# File 'lib/iron_admin/configuration/theme.rb', line 69 def scope_inactive @scope_inactive end |
#sidebar_bg ⇒ String
Returns Sidebar background classes.
79 80 81 |
# File 'lib/iron_admin/configuration/theme.rb', line 79 def @sidebar_bg end |
#sidebar_group_label ⇒ String
Returns Sidebar group label classes.
91 92 93 |
# File 'lib/iron_admin/configuration/theme.rb', line 91 def @sidebar_group_label end |
#sidebar_link ⇒ String
Returns Sidebar link classes.
85 86 87 |
# File 'lib/iron_admin/configuration/theme.rb', line 85 def @sidebar_link end |
#sidebar_link_hover ⇒ String
Returns Sidebar link hover classes.
88 89 90 |
# File 'lib/iron_admin/configuration/theme.rb', line 88 def @sidebar_link_hover end |
#sidebar_title ⇒ String
Returns Sidebar title text classes.
82 83 84 |
# File 'lib/iron_admin/configuration/theme.rb', line 82 def @sidebar_title end |
#table_border ⇒ String
Returns Table border/divider classes.
120 121 122 |
# File 'lib/iron_admin/configuration/theme.rb', line 120 def table_border @table_border end |
#table_header_bg ⇒ String
Returns Table header background classes.
114 115 116 |
# File 'lib/iron_admin/configuration/theme.rb', line 114 def table_header_bg @table_header_bg end |
#table_row_hover ⇒ String
Returns Table row hover classes.
117 118 119 |
# File 'lib/iron_admin/configuration/theme.rb', line 117 def table_row_hover @table_row_hover end |