Skip to content

Home hero: align with the gutter, keep the effect off the text on phones, keep header tools on narrow screens - #71

Closed
zabarov wants to merge 1 commit into
mainfrom
fix/home-hero-header-1505
Closed

zabarov wants to merge 1 commit into
mainfrom
fix/home-hero-header-1505

Conversation

@zabarov

@zabarov zabarov commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Three defects seen on ui-doc (Docara 3.16.0 + SIMAI Framework pair 5.20261116.1505).

Changes

  1. Full-width blocks and the scrollbar. Landing full-width blocks used width:100vw; margin-inline:calc(50% - 50vw). 100vw counts a classic vertical scrollbar, so the hero sat half a scrollbar to the left. The shell now measures the scrollbar (innerWidth - clientWidth, again on resize and when it comes or goes) into --docara-scrollbar-inline-size, and the block leaves it out. Overlay scrollbars measure 0.
  2. Hero effect on narrow screens. New hero option effect_narrow (hide by default, or show). Below md (44rem, 704 px) the hero is one column and its text spans the block, so with hide the effect layer and the pause button are not shown, the hero keeps the surface it has before an effect runs, and the shell pauses the effect. From md it runs again. show keeps the old behaviour. Catalogue definition, vocabulary, ru description, generated parameter tables and the effects/hero/error docs (ru, en) are updated.
  3. Header tools with sf-header-site 1.11. When collapsed, the bar moves the slotted tools element that holds a setting (the language picker) into its panel. Docara put search, language and reader settings in one element, so a narrow page with a language picker (the home page) kept only the menu and the logo. PortableSiteHeader::splitTools now makes the language picker a tools element of its own between the tools before and after it. Wide, the order stays search, language, settings. Collapsed, only the language moves to the panel's Settings group. The sf-language placeholder size rule follows it into .sf-site-header-tools.

Measurements

These come from the ui-doc stand (Docara 3.16 + pair 1505) built with this branch overlaid, /ru/, headless Chrome with classic scrollbars (14 px). Each run was repeated and gave the same numbers.

before after
hero heading x / page gutter, 390 light+dark 5 / 12 12 / 12
hero heading x / page gutter, 1440 light+dark 41 / 48 48 / 48
hero box left / width, 390 -7 / 390 0 / 376
hero box left / width, 1440 -7 / 1440 0 / 1426
heading x / gutter at 768 and 1920 41/41, 169/169 41/41, 169/169
horizontal overflow 0 0
effect layer at 390 drawn under the text display:none, pause button hidden
effect layer at 768 and 1440 drawn drawn
header buttons at 390 menu only menu, search, reading settings (language in the panel's Settings)
header buttons at 1440 search, language, settings search, language, settings
/en/ header at 390 menu only menu, reading settings
/ru/guide/ header unchanged unchanged

When the window is resized from 768 to 600, the layer is hidden and the effect is paused live.

Checks

  • vendor/bin/pint --test: passed

  • vendor/bin/phpunit full suite: 1160 tests. The first run had 1 error and 2 failures:

    • two assertions that expected the old header markup and the old generated parameter table, both fixed in this branch;
    • one verify-static-build.php 60 s timeout while a site build ran in parallel.

    All three tests then passed when rerun.

  • New or updated tests: PortableSiteHeaderTest (language split, no split without a picker), HeroEffectTest (effect_narrow attribute, refusal, CSS and shell contract), ArticleLayoutContractTest (scrollbar-aware full-width rule and measurement).

🤖 Generated with Claude Code

…phones, keep header tools on narrow screens

- Full-width landing blocks left out a classic scrollbar: 100vw counts it, so
  the hero sat half a scrollbar to the left (heading at 5 px instead of the
  12 px gutter at 390, 41 instead of 48 at 1440). The shell measures the
  scrollbar into --docara-scrollbar-inline-size and the block leaves it out.
- Hero effect_narrow (hide by default, or show): below md (44rem) the hero
  text spans the block, so the background effect is not shown there; the
  hero keeps its pre-effect surface, the pause button is hidden and the
  effect is paused.
- sf-header-site 1.11 moves the slotted tools element that holds the
  language picker into its panel when collapsed; search and reader settings
  were in that same element, so a narrow page with a language picker kept
  only the menu and the logo. The language picker is now a tools element of
  its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zabarov added a commit that referenced this pull request Nov 17, 2026
Owner decision q-93ec44ea27: no effect_narrow parameter. Below md the
effect is always hidden under a one-column hero, as PR #71
did by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zabarov

zabarov commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Released in Docara 3.17.0 via local main (f7c9dba, ac9efeb; effect_narrow dropped by owner decision in 0088eac).

@zabarov zabarov closed this Nov 17, 2026
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.

1 participant