Prismic
Read post

Smarter Slice Spacing in Prismic

Three techniques for making Prismic slices respond intelligently to their surroundings: establishing a shared spacing baseline with a reusable Bounded component, auto-collapsing doubled gaps between adjacent slices with the same background using CSS sibling selectors, and reading slice data (index and neighbors) via SliceZone props to conditionally adjust padding. Code examples use React and Tailwind CSS but the patterns are framework-agnostic.

    #react#css#tailwind-css
Jun 25•6m read time•From prismic.io
Post cover image
Table of contents
A note about the slice simulatorSet a baseline: Use consistent spacingBreak the baseline: Collapse spacing automaticallyAdapt to the environment: Read slices as dataWrap-up
25.1K Impressions2 Comments
Prismic's image
Prismic

Prismic offers insights into headless CMS (Content Management System) technology, content modeling, ...

155 Followers

•

2.8K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard