@sanity/ui 4.4.7 → 4.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/dist/styles.css +616 -620
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -32,6 +32,12 @@ root.render(
32
32
  )
33
33
  ```
34
34
 
35
+ ## Load order
36
+
37
+ `@sanity/ui/styles.css` is plain CSS without cascade layers: when two rules with the same specificity set the same property on an element, the one that loads last wins. Your styled-components overrides, such as `styled(Button)`, often have the same specificity as the static styles they override, so **`@sanity/ui/styles.css` must load before styled-components' `<style data-styled>` tag**, or those overrides break.
38
+
39
+ Importing the stylesheet in your entry point, before anything renders, as above, gives this order: styled-components adds its tag to the end of `<head>` the first time it renders. Check the order in your browser's devtools if the stylesheet loads lazily, in a code-split chunk, or if a framework such as Next.js decides where stylesheets go.
40
+
35
41
  ## Contributing and releasing new versions to npm
36
42
 
37
43
  This package lives in the [`sanity-io/ui` monorepo](https://github.com/sanity-io/ui) and uses [Changesets](https://github.com/changesets/changesets) to manage versioning and publishing.