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

enhance: add text and background color support #145

Merged

Conversation

aon21
Copy link
Contributor

@aon21 aon21 commented Dec 14, 2022

No description provided.

@Log1x Log1x self-requested a review February 6, 2023 13:27
@Log1x Log1x self-assigned this Feb 6, 2023
@Log1x Log1x added the enhancement New feature or request label Feb 6, 2023
@Log1x
Copy link
Owner

Log1x commented Feb 6, 2023

The latest changes on this look good! I'll try to test it sometime this week. :)

@felipefanucchi
Copy link

Any expectations of when this will get merged? 👀

@Log1x
Copy link
Owner

Log1x commented Jul 29, 2023

I'm a little confused by the output of the inlineStyle stuff to get spacing/etc. If I dump $block->style I seem to get:

+"style": array:1 [▼
  "spacing" => array:1 [▼
    "padding" => array:4 [▼
      "top" => "var:preset|spacing|70"
      "right" => "var:preset|spacing|70"
      "bottom" => "var:preset|spacing|70"
      "left" => "var:preset|spacing|70"
    ]
  ]
]

where each value is var:preset|spacing|xx which wouldn't be valid when inlined in the style tag of the block.

I think it was generally supposed to output the actual CSS var like var(--preset-spacing-70) I think?

Did something change between the initial PR and now? Am I missing something? Do we need to deserialize this ourselves? 😩

@aon21
Copy link
Contributor Author

aon21 commented Jul 29, 2023

Actually there was more issues to it.
Added a css formatter as a helper to build css correctly. Didn't want to put it in the same file as its already very big.
Updated gradients to be returned in classes and in inline style.
As there are two ways how wp adds gradients:

  1. When selecting in Collor picker, wp adds css as inline style.
  2. When using gradient presets, wp adds it as class.

Updated stubs too.

@Log1x
Copy link
Owner

Log1x commented Jul 29, 2023

Nice! I will get to this when I wake up. Was waiting on this before I push a release.

I think we could probably move the CssFormatter into a Trait inside of the Concerns directory and name it something like FormatsStyles or FormatsCss.

Also need to add color stuff to the construct block stub.

@aon21
Copy link
Contributor Author

aon21 commented Jul 30, 2023

Thats a good idea. Moved it into a Trait.

@Log1x Log1x merged commit 87fa991 into Log1x:master Aug 1, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants