Skip to content

Commit c616b8c

Browse files
committed
fix(editor): put checkerboard behind color swatch, not on top
The checkerboard pattern was rendered as background-image on the same element as the inline background-color, which meant it painted over the color. Move the checkerboard to a ::before pseudo-element with z-index -1 so it only shows through transparent/semi-transparent colors. https://claude.ai/code/session_01G7EiAdwAzdi7qzeYditnic
1 parent f4a3c54 commit c616b8c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

packages/ui/src/components/editor/editor-styles.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,23 @@
165165
/* Color swatch for inline code containing CSS color values */
166166
.cept-color-swatch {
167167
display: inline-block;
168+
position: relative;
168169
width: 0.8em;
169170
height: 0.8em;
170171
border-radius: 2px;
171172
margin-right: 0.25em;
172173
vertical-align: -0.05em;
173174
border: 1px solid rgba(0, 0, 0, 0.15);
174-
/* Checkerboard pattern to reveal transparency in alpha colors */
175+
/* background-color is set via inline style in the widget */
176+
}
177+
178+
/* Checkerboard behind the color — only visible through transparent/semi-transparent colors */
179+
.cept-color-swatch::before {
180+
content: '';
181+
position: absolute;
182+
inset: 0;
183+
border-radius: inherit;
184+
z-index: -1;
175185
background-image:
176186
linear-gradient(45deg, #ccc 25%, transparent 25%),
177187
linear-gradient(-45deg, #ccc 25%, transparent 25%),

0 commit comments

Comments
 (0)