Add a customisable shadow to canvas boxes
Test and deploy / test (push) Successful in 2m11s
Test and deploy / deploy (push) Successful in 1m21s
Weekly Maintenance / maintenance (push) Successful in 6m55s

A box can now cast a shadow, independent of its frame: ticking "Shadow" in
the box editor gives a hard offset shadow, and Hard/Soft/Glow presets or any
typed CSS box-shadow value customise it. The value is stored on Box and
Component and carried through duplicates, components and layouts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-23 23:18:35 +01:00
co-authored by Claude Opus 5.5
parent e764078aaf
commit 8bf70c98e8
15 changed files with 243 additions and 19 deletions
+4
View File
@@ -24,6 +24,8 @@ type Box {
h: Int!
z: Int!
framed: Boolean!
# A CSS box-shadow value, or "" for none.
shadow: String!
hideOnMobile: Boolean!
adminOnly: Boolean!
componentId: ID
@@ -41,6 +43,7 @@ input CreateBoxInput {
h: Int
z: Int
framed: Boolean
shadow: String
hideOnMobile: Boolean
adminOnly: Boolean
# Links the new box to this component; kind is then "html" and html is
@@ -58,6 +61,7 @@ input UpdateBoxInput {
h: Int
z: Int
framed: Boolean
shadow: String
hideOnMobile: Boolean
adminOnly: Boolean
}
+5 -2
View File
@@ -2,7 +2,7 @@
# as a copy (an ordinary box) or linked (a Box whose componentId is set).
# Linked boxes share only the html — editing a component changes every box
# linked to it — while title, geometry, frame and visibility stay each box's
# own. title, w, h, framed and adminOnly here are what a newly placed box
# own. title, w, h, framed, shadow and adminOnly here are what a newly placed box
# starts with. See models.Component and graph/component_helpers.go.
#
# Admin only throughout, reads included, because a component may have been
@@ -19,6 +19,7 @@ type Component {
w: Int!
h: Int!
framed: Boolean!
shadow: String!
adminOnly: Boolean!
# How many boxes are linked to it.
uses: Int!
@@ -31,6 +32,7 @@ input CreateComponentInput {
w: Int
h: Int
framed: Boolean
shadow: String
adminOnly: Boolean
}
@@ -41,6 +43,7 @@ input UpdateComponentInput {
w: Int
h: Int
framed: Boolean
shadow: String
adminOnly: Boolean
}
@@ -57,7 +60,7 @@ extend type Mutation {
# no page changes.
deleteComponent(id: ID!): Component! @admin
# Makes html box `id` into a component named `name`, from its html, title,
# size, frame and adminOnly, and links the box to it. Answers with the box.
# size, frame, shadow and adminOnly, and links the box to it. Answers with the box.
saveBoxAsComponent(id: ID!, name: String!): Box! @admin
# Gives linked box `id` its own copy of the component's html and unlinks it.
detachBox(id: ID!): Box! @admin