Skip to content

Commit b62f83c

Browse files
authored
Merge pull request #34 from wpgaurav/claude/add-svg-icon-module-DxulI
Fix SVG Icons module issues
2 parents fa92987 + 0f71308 commit b62f83c

4 files changed

Lines changed: 223 additions & 325 deletions

File tree

assets/css/svg-icons-editor.css

Lines changed: 55 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
/* Icon placeholder in editor */
99
.func-icon {
10-
display: inline-flex;
11-
align-items: center;
12-
justify-content: center;
10+
display: inline;
1311
vertical-align: middle;
1412
}
1513

@@ -18,203 +16,94 @@
1816
height: 1em;
1917
fill: currentColor;
2018
vertical-align: -0.125em;
19+
display: inline-block;
2120
}
2221

2322
/* Popover styles */
2423
.func-svg-icon-popover {
2524
z-index: 100001;
2625
}
2726

28-
.func-svg-icon-picker {
29-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
30-
}
31-
32-
/* Icon grid */
33-
.func-svg-icon-grid {
34-
scrollbar-width: thin;
35-
scrollbar-color: #c3c4c7 transparent;
36-
}
37-
38-
.func-svg-icon-grid::-webkit-scrollbar {
39-
width: 6px;
40-
}
41-
42-
.func-svg-icon-grid::-webkit-scrollbar-track {
43-
background: transparent;
27+
.func-svg-icon-popover .components-popover__content {
28+
padding: 0;
4429
}
4530

46-
.func-svg-icon-grid::-webkit-scrollbar-thumb {
47-
background-color: #c3c4c7;
48-
border-radius: 3px;
31+
.func-svg-icon-picker {
32+
padding: 12px;
33+
min-width: 280px;
34+
max-width: 340px;
4935
}
5036

51-
/* Icon button in grid */
52-
.func-svg-icon-button svg {
53-
width: 20px;
54-
height: 20px;
55-
fill: currentColor;
56-
color: #1e1e1e;
37+
.func-icon-search {
38+
margin-bottom: 12px !important;
5739
}
5840

59-
.func-svg-icon-button:focus {
60-
outline: 2px solid #007cba;
61-
outline-offset: -2px;
62-
box-shadow: none;
41+
.func-icon-search input {
42+
width: 100%;
6343
}
6444

65-
/* Admin icon management styles */
66-
.func-svg-icons-admin {
67-
max-width: 800px;
45+
/* Icon grid in popover */
46+
.func-icon-grid {
47+
display: grid;
48+
grid-template-columns: repeat(6, 1fr);
49+
gap: 6px;
50+
max-height: 240px;
51+
overflow-y: auto;
52+
padding: 4px;
6853
}
6954

70-
.func-svg-icons-list {
71-
margin-top: 20px;
55+
.func-icon-grid::-webkit-scrollbar {
56+
width: 6px;
7257
}
7358

74-
.func-svg-icon-item {
75-
display: flex;
76-
align-items: center;
77-
gap: 16px;
78-
padding: 12px 16px;
79-
background: #fff;
80-
border: 1px solid #c3c4c7;
81-
border-radius: 4px;
82-
margin-bottom: 8px;
59+
.func-icon-grid::-webkit-scrollbar-track {
60+
background: #f0f0f0;
61+
border-radius: 3px;
8362
}
8463

85-
.func-svg-icon-item:hover {
86-
border-color: #2271b1;
64+
.func-icon-grid::-webkit-scrollbar-thumb {
65+
background: #c0c0c0;
66+
border-radius: 3px;
8767
}
8868

89-
.func-svg-icon-preview {
90-
width: 32px;
91-
height: 32px;
69+
/* Icon button in grid */
70+
.func-icon-btn {
9271
display: flex;
9372
align-items: center;
9473
justify-content: center;
95-
background: #f6f7f7;
74+
width: 40px;
75+
height: 40px;
76+
padding: 8px;
77+
border: 1px solid #ddd;
9678
border-radius: 4px;
97-
flex-shrink: 0;
98-
}
99-
100-
.func-svg-icon-preview svg {
101-
width: 24px;
102-
height: 24px;
103-
fill: currentColor;
104-
color: #1d2327;
105-
}
106-
107-
.func-svg-icon-info {
108-
flex: 1;
109-
min-width: 0;
110-
}
111-
112-
.func-svg-icon-name {
113-
font-weight: 600;
114-
font-size: 14px;
115-
color: #1d2327;
116-
margin: 0 0 2px;
117-
}
118-
119-
.func-svg-icon-slug {
120-
font-size: 12px;
121-
color: #646970;
122-
font-family: monospace;
123-
margin: 0;
124-
}
125-
126-
.func-svg-icon-actions {
127-
display: flex;
128-
gap: 8px;
129-
flex-shrink: 0;
130-
}
131-
132-
/* Add icon form */
133-
.func-svg-add-form {
134-
background: #f6f7f7;
135-
border: 1px solid #c3c4c7;
136-
border-radius: 4px;
137-
padding: 20px;
138-
margin-bottom: 20px;
139-
}
140-
141-
.func-svg-add-form h3 {
142-
margin-top: 0;
143-
margin-bottom: 16px;
144-
}
145-
146-
.func-svg-form-row {
147-
margin-bottom: 16px;
148-
}
149-
150-
.func-svg-form-row:last-child {
151-
margin-bottom: 0;
152-
}
153-
154-
.func-svg-form-row label {
155-
display: block;
156-
font-weight: 600;
157-
margin-bottom: 6px;
158-
font-size: 13px;
159-
}
160-
161-
.func-svg-form-row input[type="text"],
162-
.func-svg-form-row textarea {
163-
width: 100%;
164-
max-width: 400px;
165-
}
166-
167-
.func-svg-form-row textarea {
168-
min-height: 150px;
169-
font-family: monospace;
170-
font-size: 12px;
171-
}
172-
173-
.func-svg-preview-area {
174-
display: flex;
175-
align-items: center;
176-
gap: 16px;
177-
padding: 16px;
17879
background: #fff;
179-
border: 1px solid #c3c4c7;
180-
border-radius: 4px;
181-
margin-top: 12px;
182-
}
183-
184-
.func-svg-preview-box {
185-
width: 48px;
186-
height: 48px;
187-
display: flex;
188-
align-items: center;
189-
justify-content: center;
190-
background: #f6f7f7;
191-
border-radius: 4px;
80+
cursor: pointer;
81+
transition: all 0.15s ease;
19282
}
19383

194-
.func-svg-preview-box svg {
195-
max-width: 32px;
196-
max-height: 32px;
84+
.func-icon-btn:hover {
85+
border-color: #007cba;
86+
background: #f0f6fc;
87+
transform: scale(1.05);
19788
}
19889

199-
/* Empty state */
200-
.func-svg-empty {
201-
text-align: center;
202-
padding: 40px 20px;
203-
background: #f6f7f7;
204-
border: 1px dashed #c3c4c7;
205-
border-radius: 4px;
206-
color: #646970;
90+
.func-icon-btn:focus {
91+
outline: 2px solid #007cba;
92+
outline-offset: -2px;
93+
box-shadow: none;
20794
}
20895

209-
.func-svg-empty .dashicons {
210-
font-size: 48px;
211-
width: 48px;
212-
height: 48px;
213-
color: #c3c4c7;
214-
margin-bottom: 12px;
96+
.func-icon-btn svg {
97+
width: 22px;
98+
height: 22px;
99+
fill: currentColor;
100+
color: #1e1e1e;
215101
}
216102

217-
.func-svg-empty p {
218-
margin: 0;
219-
font-size: 14px;
103+
/* Make SVGs inside icon buttons scale properly */
104+
.func-icon-btn svg[viewBox] {
105+
width: 100%;
106+
height: 100%;
107+
max-width: 22px;
108+
max-height: 22px;
220109
}

0 commit comments

Comments
 (0)