Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove block options #4401

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Remove block options #4401

wants to merge 1 commit into from

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented Nov 15, 2024

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

  • some blocks have options, which are passed to them to control things like inverse and margin when they're inside other blocks
  • for example, all blocks within a hero block text box need to be inverse because the background colour is dark blue, otherwise the text would be unreadable

Things to do:

  • update blocks documentation

Why

  • I came up with this system, but I now think it's confusing as blocks do 'magic' things to make them appear correctly and these things are effectively hard coded, removing control
  • so I'm removing this, and moving all the options into the YAML so they can be controlled from there
  • it makes the YAML a bit more verbose, but I think makes adding and configuring blocks clearer

Visual changes

None, but we might need to update some of the data currently in draft otherwise the pages are going to have visual/layout problems.

- some blocks have options, which are passed to them to control things like inverse and margin when they're inside other blocks
- for example, all blocks within a hero block text box need to be inverse because the background colour is dark blue, otherwise the text would be unreadable
- I came up with this system, but I now think it's confusing as blocks do 'magic' things to make them appear correctly and these things are effectively hard coded, removing control
- so I'm removing this, and moving all the options into the YAML so they can be controlled from there
- it makes the YAML a bit more verbose, but I think makes adding and configuring blocks clearer
@andysellick
Copy link
Contributor Author

@leenagupte does this PR seem sensible to you? Options seemed like a good idea at the time, but they're starting to get in the way, particularly in light of #4400

@leenagupte
Copy link
Contributor

leenagupte commented Nov 15, 2024

@leenagupte does this PR seem sensible to you? Options seemed like a good idea at the time, but they're starting to get in the way, particularly in light of #4400

So reason that block options were added in the first place, is that everything that's configured in the blocks will appear in the content item. And it feels very odd to define such purely low-level presentational things like "margin-bottom" in the content item. It felt like the type of block should be able to handle this stuff. i.e. the block should be able to figure out the margin it needs based on information it has about itself. i.e. if it's minimal, or is a full-width block.

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