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

Docs separate css blocks by example #5050

Merged
merged 32 commits into from
Oct 26, 2023
Merged

Docs separate css blocks by example #5050

merged 32 commits into from
Oct 26, 2023

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Sep 8, 2023

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Tracking

  • SearchField
  • DateField
  • ComboBox
    • FYI Help text example pretty broken on main
  • DateRangePicker
  • DatePicker
  • RangeCalendar
  • Calendar
  • ListBox
  • GridList
  • Group
    • Import button?
  • Menu
  • Popover
  • Dialog
  • DropZone
  • Modal
  • Breadcrumbs
    • Doesn’t really share much from link
  • ProgressBar
  • Meter
  • Link
  • CheckboxGroup
  • RadioGroup
  • NumberField
  • FileTrigger
  • Checkbox
    • Invalid doesn’t pass contrast darkmode
  • Button
  • Select
  • Slider
  • Switch
  • Table
  • Tabs
    • Links look different, should change? See just before “State” section
  • TagGroup
  • TextField
  • TimeField
  • ToggleButton
    • Halo focus hcm?
  • Tooltip

@snowystinger snowystinger changed the title Separate css blocks by example Docs separate css blocks by example Sep 8, 2023
@rspbot
Copy link

rspbot commented Oct 10, 2023

@devongovett
Copy link
Member

I think the importing is good. I'm a little worried that we have maybe split things into too many layers though? Like maybe we could only use layers where we actually need them in order to solve an ordering issue and not all the time? I think the original intent was to split the CSS at the top of the page up into more sections further down, and the ordering issue might arise from that. But in many cases that isn't an actual problem so we don't really need layers then. For example we don't really need HCM to be on a separate layer in many of the pages. Maybe we can chat about it before you go too much further.

@snowystinger
Copy link
Member Author

I think the importing is good. I'm a little worried that we have maybe split things into too many layers though? Like maybe we could only use layers where we actually need them in order to solve an ordering issue and not all the time? I think the original intent was to split the CSS at the top of the page up into more sections further down, and the ordering issue might arise from that. But in many cases that isn't an actual problem so we don't really need layers then. For example we don't really need HCM to be on a separate layer in many of the pages. Maybe we can chat about it before you go too much further.

So one thing I've noticed is that with layers, the order of imports matters, this makes sense because it determines the order in which layers are declared. However, if we don't have layers, then not only does order matter, but also specificity. I think it's better to only have one of those to worry about.

I think we could do a single layer per component. But I'm still worried about the amount of overriding we'll need.

@rspbot
Copy link

rspbot commented Oct 12, 2023

@rspbot
Copy link

rspbot commented Oct 17, 2023

@rspbot
Copy link

rspbot commented Oct 17, 2023

@rspbot
Copy link

rspbot commented Oct 17, 2023

@snowystinger snowystinger marked this pull request as ready for review October 18, 2023 07:49
@rspbot
Copy link

rspbot commented Oct 18, 2023

@rspbot
Copy link

rspbot commented Oct 18, 2023

Copy link
Member

@yihuiliao yihuiliao left a comment

Choose a reason for hiding this comment

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

Only took a look at the components starting with T's so far

# Conflicts:
#	packages/react-aria-components/docs/DropZone.mdx
@rspbot
Copy link

rspbot commented Oct 20, 2023

@rspbot
Copy link

rspbot commented Oct 20, 2023

packages/react-aria-components/docs/TimeField.mdx Outdated Show resolved Hide resolved
@import './Checkbox.mdx';
@import './ListBox.mdx';
@import './Popover.mdx';
```

```css
Copy link
Member

Choose a reason for hiding this comment

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

In the Reusable Wrapper section, the combobox looks like this when you have an item selected and are hovering over a different item.

Screenshot 2023-10-20 at 4 42 25 PM

But this is what it looks like in the prod docs:

Screenshot 2023-10-20 at 4 42 44 PM

Copy link
Member

Choose a reason for hiding this comment

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

Screenshot 2023-10-24 at 10 16 24 AM

Do we want the pink border around the item while hovering?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, this one is just a little confusing because it shares styles with another custom wrapper example, and I think it probably shouldn't
maybe I need some way to not export this one, can do in follow up later
for now I've just done the minimal work to get it back to how it used to look

@rspbot
Copy link

rspbot commented Oct 23, 2023

packages/dev/parcel-transformer-mdx-docs/MDXTransformer.js Outdated Show resolved Hide resolved
packages/react-aria-components/docs/DatePicker.mdx Outdated Show resolved Hide resolved
@import './Checkbox.mdx';
@import './ListBox.mdx';
@import './Popover.mdx';
```

```css
Copy link
Member

Choose a reason for hiding this comment

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

Screenshot 2023-10-24 at 10 16 24 AM

Do we want the pink border around the item while hovering?

@@ -691,39 +702,6 @@ import {Link} from 'react-aria-components';
</Router>
```

<details>
Copy link
Member

Choose a reason for hiding this comment

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

I do think the links look a bit large...maybe we should change it like you suggested

@rspbot
Copy link

rspbot commented Oct 25, 2023

@rspbot
Copy link

rspbot commented Oct 25, 2023

@rspbot
Copy link

rspbot commented Oct 25, 2023

@rspbot
Copy link

rspbot commented Oct 26, 2023

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM, the shared css importing + block separation by variant makes the css more readable, especially for cases like Dialog/DatePicker/etc.

@rspbot
Copy link

rspbot commented Oct 26, 2023

@rspbot
Copy link

rspbot commented Oct 26, 2023

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@snowystinger snowystinger merged commit 02fa455 into main Oct 26, 2023
26 checks passed
@snowystinger snowystinger deleted the separate-css-for-docs branch October 26, 2023 21:14
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.

None yet

5 participants