Skip to content

Refactor and generalize css for floated blocks#833

Open
TimoBroeskamp wants to merge 17 commits into
mainfrom
floatingBlocksUpdateCSS
Open

Refactor and generalize css for floated blocks#833
TimoBroeskamp wants to merge 17 commits into
mainfrom
floatingBlocksUpdateCSS

Conversation

@TimoBroeskamp
Copy link
Copy Markdown
Contributor

I updated the css for floating blocks like image maps and video blocks that are aligned left or right according to the figma design.
https://gitlab.kitconcept.io/kitconcept/distribution-kitconcept-intranet/-/issues/351

@danalvrz danalvrz changed the title updated css for floating blocks according to new figma specs Refactor and generalize css for floating blocks Apr 13, 2026
@danalvrz danalvrz changed the title Refactor and generalize css for floating blocks Refactor and generalize css for floated blocks Apr 13, 2026
Copy link
Copy Markdown
Member

@sneridagh sneridagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, aside of all my comments, there is a major thing: The value of the CSS property are saved in the field. We moved to have literals on the field, then we use a styleDefinition to make the interpolation on runtime.

I know that the alignment has only one CSS property, but you never know if at some moment we will need it to be mapped to more...

Please read the code and the docs on how to do this:

https://volto-light-theme.readthedocs.io/reference/widgets.html#colorswatch

See styleFieldDefinition utility.

Comment thread frontend/packages/volto-light-theme/src/components/Blocks/Image/Edit.jsx Outdated
},
);

// Blocks alignment convenience classes injection
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need at all the classnameExtender if we are controlling all via CSS props?

@@ -0,0 +1,10 @@
/**
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the GDPR block is customizing this... we will have to adapt it adding it this customization, and then what it does pushes. Plus the changes we need to apply this week. And I bet it's customizing the original Volto one. Probably we will have to centralize the customization in here or duplicate the override.

/cc @davisagli @danalvrz

Comment thread frontend/packages/volto-light-theme/src/transforms/to6.ts
@sneridagh
Copy link
Copy Markdown
Member

@TimoBroeskamp @danalvrz Ah, and a last thing. From now on, we don't ship anything that is not tested in full. Nowadays is almost for free (agents).

@danalvrz
Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants