Skip to content

docs(Text): add description #9583

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

Merged
merged 2 commits into from
Oct 9, 2023
Merged

Conversation

kmcfaul
Copy link
Contributor

@kmcfaul kmcfaul commented Sep 11, 2023

What: Closes #8413

@patternfly-build
Copy link
Contributor

patternfly-build commented Sep 11, 2023

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

LGTM! One nit about the Oxford Comma®

@@ -5,41 +5,52 @@ cssPrefix: pf-v5-c-content
propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
---

The `Text` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote` and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `Text` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote` and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).
The `Text` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote`, and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Funny cause I'm usually pro oxford comma, must've missed it haha.

@@ -5,41 +5,52 @@ cssPrefix: pf-v5-c-content
propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
---

The `Text` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote` and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).

Other components are not supported as children of `Text`, and may cause styling overrides or other conflicts. For example, the `List` and `Title` components are meant for more complex use cases and should not be nested inside `Text` for simple blocks - `TextList` and `Text` with the `component="h1"` property should be used instead. Instead of `Divider`, `Text` expects to contain an `hr` which it styles as a divider.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -5,41 +5,52 @@ cssPrefix: pf-v5-c-content
propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
---

The `Text` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote` and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `Text` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote` and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).
The `<Text>` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property (`h1` through `h6`, `p`, `a`, `small`, `blockquote` and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).

adding onto what Michael said - just some formatting fixes

Copy link
Contributor

Choose a reason for hiding this comment

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

I like wrapping the component in <>, it helps differentiate a component from a prop. Tho should we also update this?

(TextContent, TextList, TextListItem)

to

(<TextContent>, <TextList>, <TextListItem>).

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yes, missed those!

@@ -5,41 +5,52 @@ cssPrefix: pf-v5-c-content
propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
---

The `Text` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote` and `pre`), as well as the text component suite (`TextContent`, `TextList`, `TextListItem`).

Other components are not supported as children of `Text`, and may cause styling overrides or other conflicts. For example, the `List` and `Title` components are meant for more complex use cases and should not be nested inside `Text` for simple blocks - `TextList` and `Text` with the `component="h1"` property should be used instead. Instead of `Divider`, `Text` expects to contain an `hr` which it styles as a divider.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Other components are not supported as children of `Text`, and may cause styling overrides or other conflicts. For example, the `List` and `Title` components are meant for more complex use cases and should not be nested inside `Text` for simple blocks - `TextList` and `Text` with the `component="h1"` property should be used instead. Instead of `Divider`, `Text` expects to contain an `hr` which it styles as a divider.
You cannot nest other components within `<Text>`, and doing so can cause styling overrides or other conflicts. Instead, you can use the `<Text>` component's properties to achieve the same results.
For example, rather than nesting the `<List>` and `<Title>` components within `<Text>`, you should pass `component="h1"` into the `<TextList>` and `<Text>` components. Similarly, when you need to add a divider , rather than passing in a separate `<Divider>` component, you should utilize the `hr` property that `<Text>` supports, which will be styled as a divider.

How do you feel about this rewording? Just trying to lead with the information that is most important to get across, and then follow with the examples.

Also, in the past I've style component names this way when I'm referring to the React component object, but if that's unnecessary we could change that strategy going forward.

Copy link
Contributor Author

@kmcfaul kmcfaul Sep 19, 2023

Choose a reason for hiding this comment

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

👍 I like the rewording better, and like the <> too. I remember struggling a bit with the phrasing of the block because I wanted to include the couple examples without repeating the bulleted list in the original issue haha.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@edonehoo edonehoo left a comment

Choose a reason for hiding this comment

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

looks good!

@tlabaj tlabaj merged commit e50c202 into patternfly:main Oct 9, 2023
@patternfly-build
Copy link
Contributor

Your changes have been released in:

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.

Text component - improve docs around suggested use
5 participants