Skip to content

Commit 78a10a2

Browse files
mfoclaude
andcommitted
Tech: update CSS for new attachment components
Add CSS classes for FileFieldComponent: - .attachment-field for common styles - .attachment-field--single for max=1 cases - .attachment-field--multiple for max>1 cases Keep existing .attachment-drop-zone styles (reused by DropZoneDecorator). Maintain legacy styles for backward compatibility during transition. Part of attachment components refactoring (#6/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3637778 commit 78a10a2

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

app/assets/stylesheets/attachment.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,46 @@
2121
}
2222
}
2323

24+
// New unified attachment field styles
25+
.attachment-field {
26+
// Common styles for all attachment fields
27+
28+
// Anti-virus badge for just uploaded attachment when seen as downloadable
29+
.fr-download + .fr-badge {
30+
position: relative;
31+
top: -1rem;
32+
}
33+
34+
.fr-btn {
35+
align-self: flex-start;
36+
}
37+
38+
&.attachment-field--single {
39+
// Styles for single file (max=1)
40+
}
41+
42+
&.attachment-field--multiple {
43+
// Styles for multiple files (max>1)
44+
&:not(.fr-downloads-group),
45+
&.fr-downloads-group[data-controller='replace-attachment'] {
46+
ul {
47+
list-style-type: none;
48+
padding-inline-start: 0;
49+
}
50+
51+
li {
52+
padding-bottom: 0;
53+
}
54+
}
55+
56+
&.fr-downloads-group.destroyable ul {
57+
list-style-type: none;
58+
padding-inline-start: 0;
59+
}
60+
}
61+
}
62+
63+
// Legacy support for old class names (will be removed)
2464
.attachment-multiple:not(.fr-downloads-group),
2565
.attachment-multiple.fr-downloads-group[data-controller='replace-attachment'] {
2666
ul {
@@ -50,6 +90,7 @@
5090
}
5191
}
5292

93+
// Legacy support
5394
.attachment-multiple.fr-downloads-group.destroyable ul,
5495
ul[data-file-input-reset-target='fileList'] {
5596
list-style-type: none;

0 commit comments

Comments
 (0)