dorfteich/packages/plugins/section-styles-basic/styles.css
Claude Fable 5 e32f961047
All checks were successful
CI / Lint, typecheck, test (push) Successful in 2m54s
CI / Build container images (push) Has been skipped
CD / Build and push images (push) Successful in 3m9s
CD / Deploy to Test (push) Successful in 11s
CD / Smoke tests against Test (push) Successful in 1m9s
CD / Promote to Int (push) Successful in 10s
CI / Auth e2e pack (push) Successful in 3m57s
CI / Import/export fidelity gate (push) Successful in 43s
Complete section-style plugins: CSS gate, injection, picker, export (#75)
Second half of #75 on top of the section node (2e96173/784f21d):

- Install gate for section_style CSS (plugin-css.ts): every rule must be
  scoped under one of the plugin's own .dt-style-<pluginId>-<styleId>
  classes (enforced, not rewritten — grouping at-rules checked inside,
  @font-face/@keyframes exempt, statement at-rules rejected); positioning
  out of the content flow (anything but static/relative) is rejected as an
  overlay vector; "</style" is rejected as a breakout vector for inlined
  embedding. Hostile fixtures from the acceptance list are pinned in
  plugin-css.test.ts.
- Web: usePondPlugins loads the pond's active plugins once per visit;
  SectionStyleSheets links each active style plugin's immutable
  styles.css; SectionStyleMenu (toolbar) wraps/restyles/unwraps with a
  picker fed from the plugins' i18n titles. Sections show a faint dashed
  hint while editing so unstyled (plugin-disabled) sections stay findable.
- PDF export: PluginsService.sectionStyleCssForPond inlines the pond's
  active section-style CSS into the Gotenberg HTML, so styled sections
  survive the network-isolated render; covered in export.service.db.test.
- Reference plugin packages/plugins/section-styles-basic (callout, info,
  warning, colored-box; theme-neutral semi-transparent backgrounds), a
  workspace package whose tests validate it against the SDK schema and
  whose real files run through the api install gate.
- e2e section-styles.spec.ts: install → wrap → computed background in edit
  and read mode → unwrap → neutral fallback after disabling the plugin.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwZ4jR4KFAPvpjWevfUGX1
2026-07-11 11:43:36 +02:00

57 lines
1.8 KiB
CSS

/*
* Basic section styles — the declarative reference plugin (issue #75).
*
* Contract (plugin-architecture.md §Kinds, enforced at install): every rule is
* scoped under `.dt-style-section-styles-basic-<styleId>`; no @import, no
* external url(), no positioning out of the content flow. Backgrounds are
* semi-transparent and text inherits the surrounding color, so the styles
* read well on light and dark themes without knowing the host's tokens.
*/
.dt-style-section-styles-basic-callout {
background: rgba(140, 140, 140, 0.12);
border-left: 4px solid rgba(140, 140, 140, 0.9);
border-radius: 0 6px 6px 0;
padding: 0.75rem 1rem;
margin: 0.75rem 0;
}
.dt-style-section-styles-basic-info {
background: rgba(38, 139, 210, 0.12);
border-left: 4px solid rgba(38, 139, 210, 0.9);
border-radius: 0 6px 6px 0;
padding: 0.75rem 1rem;
margin: 0.75rem 0;
}
.dt-style-section-styles-basic-warning {
background: rgba(203, 75, 22, 0.14);
border-left: 4px solid rgba(203, 75, 22, 0.9);
border-radius: 0 6px 6px 0;
padding: 0.75rem 1rem;
margin: 0.75rem 0;
}
.dt-style-section-styles-basic-colored-box {
background: rgba(133, 153, 0, 0.14);
border: 1px solid rgba(133, 153, 0, 0.5);
border-radius: 8px;
padding: 1rem 1.25rem;
margin: 0.75rem 0;
}
/* Sections start/end flush: no stray outer margins on first/last children. */
.dt-style-section-styles-basic-callout > :first-child,
.dt-style-section-styles-basic-info > :first-child,
.dt-style-section-styles-basic-warning > :first-child,
.dt-style-section-styles-basic-colored-box > :first-child {
margin-top: 0;
}
.dt-style-section-styles-basic-callout > :last-child,
.dt-style-section-styles-basic-info > :last-child,
.dt-style-section-styles-basic-warning > :last-child,
.dt-style-section-styles-basic-colored-box > :last-child {
margin-bottom: 0;
}