Skip to content

docs(readme): add section for configuring css - #12616

Merged
rebeccaalpert merged 2 commits into
patternfly:mainfrom
kmcfaul:css-import-docs
Aug 10, 2026
Merged

docs(readme): add section for configuring css#12616
rebeccaalpert merged 2 commits into
patternfly:mainfrom
kmcfaul:css-import-docs

Conversation

@kmcfaul

@kmcfaul kmcfaul commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What: Closes #12567

Summary by CodeRabbit

  • Documentation
    • Added guidance for configuring PatternFly styling with the recommended package and base stylesheet.
    • Clarified that PatternFly HTML/CSS styles should not be imported directly.
    • Reorganized contribution guidelines and licensing information.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b2c9325b-1aa3-46a8-978f-b924ec5c3de8

📥 Commits

Reviewing files that changed from the base of the PR and between 1f573b0 and 44010e7.

📒 Files selected for processing (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

Walkthrough

README.md documents PatternFly styling configuration with @patternfly/react-styles, including the required base stylesheet import. It warns against direct PatternFly HTML/CSS imports and moves the unchanged contribution and license sections below the new guidance.

Changes

Styling documentation

Layer / File(s) Summary
Document styling configuration
README.md
Adds the required base stylesheet import and warns against direct PatternFly HTML/CSS imports that can duplicate stylesheets. Moves the contribution and license sections below the new guidance.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The README guidance meets part of issue #12567, but the required demo app update is not present in the changeset. Update the demo app to import @patternfly/react-core/dist/styles/base.css and demonstrate the recommended CSS configuration.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the README change that adds CSS configuration guidance.
Out of Scope Changes check ✅ Passed The README edits support the linked issue and do not introduce unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
README.md (1)

89-89: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Name the conflicting import explicitly.

Replace the broad PatternFly HTML/CSS library wording with @patternfly/patternfly/patternfly.css. This makes the duplicate stylesheet fix actionable and matches the PR objective.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 89, Update the README wording to explicitly identify
`@patternfly/patternfly/patternfly.css` instead of referring broadly to the
PatternFly HTML/CSS library, while preserving the guidance about avoiding
duplicate stylesheets when using PatternFly React.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 82-89: Move the “Configure PatternFly styling” section from the
repository-root README.md into packages/react-core/README.md, preserving its CSS
import guidance and warning about duplicate stylesheets. Remove the section from
the root README so the package-specific documentation is the single source.
- Around line 85-87: Update the JavaScript code fence around the PatternFly
stylesheet import in README.md to use the js language identifier, changing the
opening fence from ``` to ```js while preserving the import and closing fence.

---

Nitpick comments:
In `@README.md`:
- Line 89: Update the README wording to explicitly identify
`@patternfly/patternfly/patternfly.css` instead of referring broadly to the
PatternFly HTML/CSS library, while preserving the guidance about avoiding
duplicate stylesheets when using PatternFly React.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 65a928e5-0a58-49c0-abfd-7d0399c0284c

📥 Commits

Reviewing files that changed from the base of the PR and between 759a598 and 1f573b0.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md Outdated
Comment on lines +82 to +89
#### Configure PatternFly styling
PatternFly uses the [`@patternfly/react-styles` package](https://www.npmjs.com/package/@patternfly/react-styles) as a translation layer to reference the styles contained in the PatternFly HTML/CSS library. When developing with Patternfly React, include the following import at the base level of your application to pull in PatternFly's styling:

```
import '@patternfly/react-core/dist/styles/base.css';
```

Importing css directly from the PatternFly HTML/CSS library while using PatternFly React may result in duplicated stylesheets in the browser as PatternFly React already pulls in styles internally via `@patternfly/react-styles`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Place the guidance in packages/react-core/README.md.

The PR objective requires this section in the react-core package README. The changed file is the repository-root README.md. Add or move the section to packages/react-core/README.md so users of @patternfly/react-core can find the required CSS setup instructions with the package documentation.

🧰 Tools
🪛 markdownlint-cli2 (0.23.2)

[warning] 85-85: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 82 - 89, Move the “Configure PatternFly styling”
section from the repository-root README.md into packages/react-core/README.md,
preserving its CSS import guidance and warning about duplicate stylesheets.
Remove the section from the root README so the package-specific documentation is
the single source.

Comment thread README.md
Comment on lines +85 to +87
```
import '@patternfly/react-core/dist/styles/base.css';
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Specify the JavaScript code fence.

Use ```js instead of ` ````. This resolves markdownlint MD040 and enables correct renderer behavior.

Proposed fix
-```
+```js
 import '`@patternfly/react-core/dist/styles/base.css`';
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)

[warning] 85-85: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 85 - 87, Update the JavaScript code fence around the
PatternFly stylesheet import in README.md to use the js language identifier,
changing the opening fence from ``` to ```js while preserving the import and
closing fence.

Source: Linters/SAST tools

@rebeccaalpert
rebeccaalpert self-requested a review August 10, 2026 14:09
Comment thread README.md Outdated
Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
@rebeccaalpert
rebeccaalpert merged commit b414ba2 into patternfly:main Aug 10, 2026
14 of 15 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-code-editor@6.6.1-prerelease.2
  • @patternfly/react-core@6.6.1-prerelease.2
  • @patternfly/react-docs@7.6.1-prerelease.2
  • @patternfly/react-drag-drop@6.6.1-prerelease.2
  • demo-app-ts@6.5.0-prerelease.121
  • @patternfly/react-table@6.6.1-prerelease.2
  • @patternfly/react-templates@6.6.1-prerelease.2

Thanks for your contribution! 🎉

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.

Document how to avoid duplicate CSS imports from PatternFly

4 participants