forked from TetsuakiBaba/invoicable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.css
More file actions
384 lines (323 loc) · 9.6 KB
/
index.css
File metadata and controls
384 lines (323 loc) · 9.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
/* ==========================================================================
INVOICABLE - MAIN STYLESHEET
========================================================================== */
/* TABLE OF CONTENTS:
1. Configuration & Variables
2. Global Resets & Body
3. Typography & Headers
4. Toolbar & Navigation
5. Form Elements & Inputs (Editable Fields)
6. Table & Invoice Items
7. PDF & Print Utilities
8. Mobile & Responsive Styles
*/
/* ==========================================================================
1. CONFIGURATION & VARIABLES
========================================================================== */
:root {
/* --- Color Palette --- */
--primary-color: #0053a6; /* Main theme color */
--primary-text-color: #ffffff; /* Text on top of primary color */
/* --- Backgrounds --- */
--bg-body: #f3f4f6; /* Main page background */
--bg-paper: #ffffff; /* Invoice paper background */
--bg-toolbar: #f8f9fa; /* Toolbar background */
--bg-toolbar-hover: #ffffff; /* Toolbar item hover background */
/* --- Text Colors --- */
--text-main: #374151; /* Standard text color */
--text-muted: #6c757d; /* Muted/Icon color */
--text-placeholder: #adb5bd; /* Placeholder text color */
--text-secondary: #4b5563; /* Secondary text color */
/* --- Borders & Lines --- */
--border-color: #e5e7eb; /* Standard border */
--border-hover: #d1d5db; /* Border color on hover */
--border-focus: #ced4da; /* Border color on focus */
/* --- Typography --- */
--font-family-sans: 'Inter', sans-serif;
--font-family-mono: 'Roboto Mono', monospace;
/* --- Spacing & Sizing --- */
--border-radius: 6px; /* Standard border radius */
--toolbar-height: 36px; /* Height of toolbar items */
--spacing-xs: 0.5px; /* Letter spacing */
}
/* ==========================================================================
2. GLOBAL RESETS & BODY
========================================================================== */
body {
background-color: var(--bg-body);
font-family: var(--font-family-sans);
color: var(--text-main);
-webkit-font-smoothing: antialiased; /* Smooth fonts on MacOS */
}
/* Utility to prevent text selection (useful for UI elements) */
.unselectable {
user-select: none;
}
/* ==========================================================================
3. TYPOGRAPHY & HEADERS
========================================================================== */
.header-title {
color: var(--primary-color);
letter-spacing: -0.5px;
}
.header-label-lg {
font-size: 0.9rem !important;
letter-spacing: 0.5px;
}
/* Decorative banner line */
.header-banner {
background-color: var(--primary-color) !important;
}
/* Helper for primary colored text */
.text-primary-custom {
color: var(--primary-color);
}
/* Extra small text utility */
.x-small {
font-size: 0.7rem;
letter-spacing: var(--spacing-xs);
}
/* Monospace font application for numbers and data */
#pdf_element .item-price,
#pdf_element .item-quantity,
#pdf_element .item-amount,
#invoice_total,
#invoice_number,
#date {
font-family: var(--font-family-mono);
letter-spacing: -0.5px;
}
/* Date Picker Styling */
.date-picker-input {
border: none;
border-bottom: 1px dashed transparent;
background: transparent;
font-family: 'Roboto Mono', monospace;
font-weight: 500;
color: #212529;
padding: 0;
width: auto;
display: inline-block;
cursor: pointer;
font-size: 1rem;
line-height: inherit;
text-align: right;
}
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
cursor: pointer;
opacity: 0.6;
}
.date-picker-input:hover {
border-bottom-color: #ced4da;
background-color: rgba(0,0,0,0.01);
}
.date-picker-input:focus {
outline: none;
box-shadow: none;
border-bottom: 1px solid var(--primary-color);
background-color: rgba(var(--primary-color), 0.05);
}
/* ==========================================================================
4. TOOLBAR & NAVIGATION
========================================================================== */
.navbar-spacer {
height: 80px;
transition: height 0.3s ease;
}
/* Container for toolbar buttons/selects */
.toolbar-item {
position: relative;
display: flex;
align-items: center;
background: var(--bg-toolbar);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
padding: 0 10px;
height: var(--toolbar-height);
transition: all 0.2s ease;
}
.toolbar-item:hover {
border-color: var(--border-hover);
background: var(--bg-toolbar-hover);
}
.toolbar-item i {
font-size: 1rem;
margin-right: 6px;
color: var(--text-muted);
}
/* Styled select inputs inside the toolbar */
.toolbar-select {
border: none;
background: transparent;
font-size: 0.85rem;
font-weight: 600;
color: var(--text-secondary);
padding: 0;
cursor: pointer;
outline: none;
box-shadow: none !important;
width: auto;
}
/* Circular Color Picker Wrapper */
.color-picker-wrapper {
width: var(--toolbar-height);
height: var(--toolbar-height);
border-radius: 50%;
overflow: hidden;
border: 2px solid var(--border-color);
cursor: pointer;
transition: transform 0.2s;
}
.color-picker-wrapper:hover {
transform: scale(1.1);
border-color: var(--border-hover);
}
/* Actual color input (hidden visually but accessible) */
.form-control-color {
width: 150%;
height: 150%;
transform: translate(-25%, -25%);
padding: 0;
border: none;
cursor: pointer;
}
/* ==========================================================================
5. FORM ELEMENTS & INPUTS (EDITABLE FIELDS)
========================================================================== */
/* Contenteditable fields styling */
.editable-field {
border-bottom: 1px dashed rgba(0, 0, 0, 0.3);
padding: 1px 0;
min-width: 30px;
outline: none;
transition: all 0.2s;
cursor: text;
line-height: 1.4;
}
.editable-field:hover {
border-bottom-color: var(--border-focus);
background-color: rgba(0, 0, 0, 0.01);
}
.editable-field:focus {
border-bottom: 1px solid var(--primary-color);
background-color: rgba(var(--primary-color), 0.05);
}
/* Placeholder behavior for empty editable fields */
.editable-field:empty:before {
content: attr(data-placeholder);
color: var(--text-placeholder);
font-style: italic;
font-weight: 400;
}
/* Prevents wrapping on specific fields until focused */
.text-nowrap-custom {
white-space: nowrap;
overflow: hidden;
}
.text-nowrap-custom:focus {
white-space: normal;
overflow: visible;
}
/* ==========================================================================
6. TABLE & INVOICE ITEMS
========================================================================== */
.item-description {
text-align: left;
}
/* Force center alignment for numeric columns */
.item-quantity,
.item-price,
.item-amount {
text-align: center !important;
}
/* Inputs inside table cells */
.table input.form-control {
border: none;
background: transparent;
box-shadow: none;
padding: 0;
font-weight: 500;
font-size: 0.9rem;
}
.table input.form-control:focus {
background: #f9fafb;
box-shadow: inset 0 -1px 0 var(--primary-color);
}
/* Delete/Action button visibility */
.action-column button {
opacity: 0.1;
transition: opacity 0.2s;
}
tr:hover .action-column button {
opacity: 1;
}
/* ==========================================================================
7. PDF & PRINT UTILITIES
========================================================================== */
/* Prevents elements from being split across pages in PDF */
.break-inside-avoid {
page-break-inside: avoid !important;
break-inside: avoid !important;
display: block;
}
tr {
page-break-inside: avoid;
break-inside: avoid;
}
/* Ensures the PDF container is always white */
#pdf_element {
background-color: var(--bg-paper) !important;
}
.pdf-clean-mode {
margin: 0 auto;
}
.pdf-clean-mode .editable-field {
border-bottom: none !important;
padding: 0 !important;
}
.pdf-clean-mode .editable-field:empty::before {
content: "" !important; /* Remove placeholders in PDF */
}
.pdf-clean-mode .col-6 {
width: 50% !important;
max-width: 50% !important;
}
.pdf-clean-mode .col-6:last-child {
display: flex;
flex-direction: column;
align-items: flex-end;
}
/* ==========================================================================
8. MOBILE & RESPONSIVE STYLES
========================================================================== */
@media (max-width: 768px) {
.navbar-spacer {
height: 150px;
}
.navbar-brand {
font-size: 1.2rem;
margin-bottom: 0.5rem;
width: 100%;
justify-content: center;
}
.toolbar-actions {
width: 100%;
justify-content: center !important;
flex-wrap: wrap;
gap: 8px !important;
}
.header-title {
font-size: 2rem;
}
.footer-actions {
flex-direction: column !important;
align-items: stretch !important; /* Full width buttons */
border-radius: 16px !important; /* Less rounded on mobile stack */
gap: 12px !important;
padding: 20px !important;
}
.footer-actions button {
width: 100%;
}
}