Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Sep 9, 2025

Summary

  • allow Simple Image block to define mobile-specific margins
  • apply responsive styles in Simple Image template to use mobile margins

Testing

  • php -l models/EverblockPrettyBlocks.php
  • composer validate --no-check-lock

https://chatgpt.com/codex/tasks/task_e_68c04cf785048322ba37b011a41aa1d6

@CySSoO CySSoO merged commit 1f9a239 into master Sep 9, 2025
0 of 6 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

{if $state.margin_left_mobile || $state.margin_right_mobile || $state.margin_top_mobile || $state.margin_bottom_mobile}
<style>
@media (max-width: 767px) {
#block-{$block.id_prettyblocks}-{$key} {
{if $state.margin_left_mobile}margin-left:{$state.margin_left_mobile|escape:'htmlall':'UTF-8'};{/if}
{if $state.margin_right_mobile}margin-right:{$state.margin_right_mobile|escape:'htmlall':'UTF-8'};{/if}
{if $state.margin_top_mobile}margin-top:{$state.margin_top_mobile|escape:'htmlall':'UTF-8'};{/if}
{if $state.margin_bottom_mobile}margin-bottom:{$state.margin_bottom_mobile|escape:'htmlall':'UTF-8'};{/if}

[P1] Make mobile margin styles override inline desktop margins

The new mobile margin fields add CSS rules inside a media query, but the desktop margins are still applied via inline style="…margin-*…" on the same element earlier in the template. Inline styles outrank ID selectors, so whenever both desktop and mobile margins are configured the desktop values remain in effect even on small screens. This makes the mobile margin settings ineffective unless the desktop fields are left blank. Moving the desktop margins to stylesheet rules or marking the mobile ones as !important would allow the responsive values to take effect.


Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants