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

Implement "insertion point" API for react-shadow #60

Merged
merged 8 commits into from
Feb 29, 2024

Conversation

spmonahan
Copy link
Contributor

@spmonahan spmonahan commented Jan 3, 2024

Adds an "insertion point" API similar to Griffel's API.

Here we use a special sentinel ExtendedCSSStyleSheet in the adoptedStyleSheets array and look it up prior to setting the stylesheets.

Additionally, a constant for whether adoptedStyleSheets is mutable is added so we can conditionally update the array. This improves Safari support. See this PR for more details.

Resolves #59

@spmonahan spmonahan requested a review from a team as a code owner January 3, 2024 23:04
Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

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

As we discussed in offline, let's introduce a factory to create root, i.e.:

const root = createRoot({ sheetInsertionPoint: sheet })

@spmonahan spmonahan requested a review from a team as a code owner February 22, 2024 23:22
@spmonahan
Copy link
Contributor Author

As we discussed in offline, let's introduce a factory to create root, i.e.:

const root = createRoot({ sheetInsertionPoint: sheet })

@layershifter Made this update.

yarn.lock Outdated Show resolved Hide resolved
Allows users to control where Griffel styles are inserted into the
adoptedStyleSheets array.
This function allows users to createa a root configured with options.
Currently the only supported option is "insertionPoint" which allows
users to control the order of stylesheets so they can affect specificity.
@spmonahan spmonahan enabled auto-merge (squash) February 24, 2024 00:18
@spmonahan
Copy link
Contributor Author

@layershifter I think I've addressed the changes we discussed. Can you remove your hold on the PR so it can be merged?

@layershifter
Copy link
Member

@layershifter I think I've addressed the changes we discussed. Can you remove your hold on the PR so it can be merged?

@spmonahan I have already approved the PR previous week 🐱

image

@microsoft/fluentui-react-build can you please check the PR? 🙏

@spmonahan spmonahan merged commit f053af1 into microsoft:main Feb 29, 2024
4 checks passed
marcosmoura added a commit to marcosmoura/fluentui-contrib that referenced this pull request Mar 6, 2024
* main:
  .
  applying package updates
  chore(react-tree-grid): release (microsoft#122)
  chore(react-tree-grid): follow up on a11y issue for Meet stories (microsoft#125)
  chore(react-tree-grid): resolve Meet stories a11y issues (microsoft#124)
  bugfix(react-tree-grid): header TreeGridCell should have role rowheader instead of columnheader (microsoft#123)
  chore(react-tree-grid): minor adjustments on stories (microsoft#117)
  Implement "insertion point" API for `react-shadow` (microsoft#60)
  create houdini-utils package (microsoft#120)
  feat(nx-plugin): add testEnvironment to library generator and render proper jest config (microsoft#121)
  chore(react-tree-grid): adds playwright component tests (microsoft#100)
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.

Add support for "insertion point" to react-shadow
4 participants