Skip to content

Conversation

@stuartromanek
Copy link
Member

No description provided.

@linear
Copy link

linear bot commented Nov 5, 2025

Copy link
Contributor

@BoDonkey BoDonkey left a comment

Choose a reason for hiding this comment

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

So I know this is a field that is going to be used primarily in the styles modal, but I can also see devs wanting to use it in their own templating. Can you give an example, like the other field types, of use in a template, please?

Copy link
Member

@boutell boutell left a comment

Choose a reason for hiding this comment

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

Just commenting...

I love this

Are the defaults of the individual fields really null? Shouldn't they be zeroes? There's no way to go back to "no value at all" once you interact with this field (I assume), so we may as well skip the compexity of null?

@BoDonkey
Copy link
Contributor

BoDonkey commented Nov 6, 2025

Just commenting...

I love this

Are the defaults of the individual fields really null? Shouldn't they be zeroes? There's no way to go back to "no value at all" once you interact with this field (I assume), so we may as well skip the compexity of null?

I'm sure Stu will chime in, but 0 is both a valid value and a potential override of other styles set elsewhere. That is why I think it needs to be null.

@boutell
Copy link
Member

boutell commented Nov 6, 2025

I was originally thinking I'd have a boolean "if" field toggling each of these anyway.

Then I removed it for padding and margin because I didn't think of the "I want to go back to not overriding" scenario.

But for border I kept the overall "do you want a border at all" boolean, because there are other border properties (e.g. radius) that can't be represented by box alone anyway.

If we want to make it possible to "re-nullify" this field through the UI, I can leave it that way. If we don't, I can just put in "do you want padding at all" and "do you want margin at all" booleans to control it via "if".

I'm good either way, let me know.

@stuartromanek
Copy link
Member Author

Just commenting...

I love this

Are the defaults of the individual fields really null? Shouldn't they be zeroes? There's no way to go back to "no value at all" once you interact with this field (I assume), so we may as well skip the compexity of null?

Setting only one of the four values should be a valid use case for this field. Marking the other 'unset' values as zero is creating overrides that may not be obvious.

You can return to the 'blank' all-null state by using the Clear button that appears once you enter any value.

@stuartromanek
Copy link
Member Author

I was originally thinking I'd have a boolean "if" field toggling each of these anyway.

Then I removed it for padding and margin because I didn't think of the "I want to go back to not overriding" scenario.

But for border I kept the overall "do you want a border at all" boolean, because there are other border properties (e.g. radius) that can't be represented by box alone anyway.

If we want to make it possible to "re-nullify" this field through the UI, I can leave it that way. If we don't, I can just put in "do you want padding at all" and "do you want margin at all" booleans to control it via "if".

I'm good either way, let me know.

You can re-nullify everything via the Clear button that appears once any value is entered.

> But for border I kept the overall "do you want a border at all" boolean, because there are other border properties (e.g. radius) that can't be represented by box alone anyway.

Specific on this idea, I think we should have a field parameter that essentially expands a field and acts as an indicator of 'i want this field'.
This would

  • Save us the goofy 'want this field?' boolean from cluttering up the schema
  • Simplify the initial state of the schema but collapsing secondary / more optional fields

See video example
https://github.com/user-attachments/assets/2c94f006-0fd5-4213-950d-c89eed701242

@boutell
Copy link
Member

boutell commented Nov 6, 2025

Got it! I stand 100% corrected re: how box works and the fact that box is already "clearable" via its UI. I'll continue the conversation about toggles and object fields outside of poor Bob's PR

@boutell
Copy link
Member

boutell commented Nov 6, 2025

(Poor Stu's PR rather heh)

@stuartromanek
Copy link
Member Author

So I know this is a field that is going to be used primarily in the styles modal, but I can also see devs wanting to use it in their own templating. Can you give an example, like the other field types, of use in a template, please?

Noted here b1773cd

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.

4 participants