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

Quick: GH-253: Tweak Style Guide CSS #325

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Aug 23, 2021

Overview

Tweak styles for manual pattern library a.k.a. style guide.

Changes

  • Do not rely on <section> tags.
  • Space content via heading tags.
  • Include breadcrumbs (and extend standard).

Testing

  1. Add ('style_guide.html', 'Style Guide'), entry to _CMS_TEMPLATES in secrets.py.

  2. Select "Style Guide" as template for a test page.

  3. On the test Style Guide page, add sections and multiple headings of different levels.

    Samples
  4. (Optional) On the test Style Guide page, perform manual testing of complex CSS:

    Markup & Checks
    • heading as direct, first child of a <section> that is not an .o-section*
      • has margin top from style guide CSS
      • has margin bottom from style guide CSS
    • heading as direct, first child of a <section class="o-section">*
      • no margin top from style guide CSS
      • has margin bottom from style guide CSS
    • heading as direct, not first child of a <section class="o-section">*
      • no margin top from style guide CSS
      • has margin bottom from style guide CSS
    • heading immediately after a non-heading, both as direct children of a <section>
      • has margin top from style guide CSS
      • has margin bottom from style guide CSS
    • heading immediately after a non-heading, both not direct children of a <section>
      • no margin top from style guide CSS
      • no margin bottom from style guide CSS
    • heading immediately after a non-heading, both as direct children of a <section>
      • no margin top from style guide CSS
      • has margin bottom from style guide CSS
    • heading immediately after a non-heading, both not direct children of a <section>
      • no margin top from style guide CSS
      • no margin bottom from style guide CSS

* An .o-section first, direct child heading should not have margin-top, because the section already adds large padding.

Screenshots

The structure of these pages has this content in this hierarchy:

  • Style with both "Advanced settings > ADDITIONAL CLASSES: o-section, o-section--style-light" and "TAG TYPE: section"
    • Text with <h1>Some title</h1>
      • content with headings, all optionally grouped within Style with "TAG TYPE: section"

- Do not rely on `<section>` tags.
- Space content via heading tags (like `s-document`).
- Include breadcrumbs (and extend standard).
- Use complex, but consistent rules.
- Avoid affecting headings within plugins.
@wesleyboar wesleyboar marked this pull request as ready for review August 23, 2021 23:11
@wesleyboar
Copy link
Member Author

Self-merging because:

  • I have tested it well.
  • I have documented the changes well.
  • There are more important PRs for others to review.
  • Use of this is for a manual pattern library which is not heavily used nor visited nor advertised; nor is it public.
  • I have started a bad habit of doing this.

@wesleyboar wesleyboar merged commit 2689b8b into main Aug 23, 2021
@wesleyboar wesleyboar deleted the quick/GH-253-style-guide-css-tweaks branch August 23, 2021 23:14
@wesleyboar wesleyboar linked an issue Aug 23, 2021 that may be closed by this pull request
3 tasks
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.

Manual Pattern Library
1 participant