You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove old site, create new Next app
* Site header
* Fix manypkg issues, copy in bootstrap-reboot.min.css
* Website progress
* Website progress
* Website progress
* yarn.lock
* Website progress
* Fix manypkg errors
* Website progress
* Website progress: markdown CSS
* Website progress
* Website progress
* Remove spectrum badge from README
* Add Carbon ads
* Add DocSearch
* Add favicon and set page <title>
* Website tweaks
* Update Netlify config and use next-export
* Remove unnecessary dependencies from root package.json
* Add custom 404 page
* Live editor works (no Babel yet)
* [wip] Babel compilation
* About to remove web worker stuff
* Website: Live code editor stuff
* Remove Mac-specific step from CONTRIBUTING
* Update CONTRIBUTING for new website development
* Done with live code editors
* Bring awesome-emotion into repo as an MDX doc
* Add redirects to netlify.toml
* Website styling, remove @jsx pragma from live code examples
* Remove incorrect slack link from community.mdx
* Review & tweak website styles
* Make tables responsive on mobile
* Set up @next/bundle-analyzer
* Get @emotion/babel-plugin to work in the browser (HACKS)
* Change Carbon ad when path changes
* Fix live editor issues
* Do LiveEditor compilation in web worker
* Fork react-live
* Working on live editors
* Fix LiveProvider useEffect
* Live editor tweaks
* Fix web worker @emotion/babel-plugin import
* Add website TS TODO
* Add more detail to comment
* Fix some but not all manypkg issues
* Fix Safari-specific styling issues
* Website: Use webpack alias for @emotion/babel-plugin
* Add comment explaining module aliasing hack
* site: Upgrade docsearch
* site: Upgrade some packages
* site: Upgrade some packages
* site: Upgrade next-mdx-remote
* Fix layout shift when carbon ads is loading
* Make CI use Node 14
This is required for next-mdx-remote v4
* Remove .nvmrc to fix Netlify build
* Add Ukraine banner to new website
* Fix minor issues in styled.mdx
* Minor mobile fixes
* Convert GFM tables to HTML so we don't need the remark-gfm plugin
* Upgrade all website packages
* Update docsearch appId and apiKey (see emotion-js#2718)
* Fixed CacheProvider demo in the docs (see emotion-js#2678)
* CodeSandbox CI node 16
* Simplify .gitignore
* Website cleanup after reviewing diff
* Fix multiple @types/react
* Add test:typescript script to emotion-site
* Make all code blocks have the same font-size
* Autolink headings
* Minor website fixes
* remark-responsive-tables
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+3-7
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,6 @@
5
5
6
6
## Installation
7
7
8
-
- (If using an M1 Mac) Install `vips` via Homebrew: `brew install vips`.
9
-
- This step can be removed from this document if we upgrade to the latest
10
-
version of Gatsby, which is compatible with sharp 0.28.0+ which does include
11
-
binaries for M1 Macs.
12
8
- (If using Windows) Enable Developer Mode in the Windows settings app. On Windows 11, this can be done by searching the start menu for "Developer settings" and then enabling the Developer Mode toggle switch.
13
9
- Run `yarn` in the repository's root directory to install everything you need for development.
14
10
- Run `yarn build` in the root directory to build the modules.
@@ -27,9 +23,9 @@
27
23
28
24
## Documentation Website Development
29
25
30
-
- Run above installation steps and then
31
-
- Run `yarn start:site` to run a development server of gatsby.
32
-
- Run `yarn build:site` to create a build of the assets for the documentation website.
26
+
- Run above installation steps and then`cd` to the `site` directory.
27
+
- Run `yarn dev` to run the Next.js development server.
28
+
- Run `yarn build` to create a build of the assets for the documentation website.
Emotion is a performant and flexible CSS-in-JS library. Building on many other CSS-in-JS libraries, it allows you to style apps quickly with string or object styles. It has predictable composition to avoid specificity issues with CSS. With source maps and labels, Emotion has a great developer experience and great performance with heavy caching in production.
Copy file name to clipboardexpand all lines: docs/babel.mdx
+7-7
Original file line number
Diff line number
Diff line change
@@ -2,26 +2,26 @@
2
2
title: 'Babel Plugin'
3
3
---
4
4
5
-
`@emotion/babel-plugin` is highly recommended. All of the options that can be provided to `@emotion/babel-plugin` are documented in [`@emotion/babel-plugin`'s README](https://github.com/emotion-js/emotion/tree/main/packages/babel-plugin).
5
+
`@emotion/babel-plugin` is highly recommended. All of the options that can be provided to `@emotion/babel-plugin` are documented in [`@emotion/babel-plugin`'s README](/docs/@emotion/babel-plugin).
6
6
7
-
###Install
7
+
## Install
8
8
9
9
In `emotion` version 8 and above, installation is optional. In older versions, installation is required. See the [installation instructions](/docs/install.mdx).
10
10
11
-
###Features which are enabled with the babel plugin
11
+
## Features which are enabled with the babel plugin
12
12
13
-
### Minification
13
+
####Minification
14
14
15
15
Any leading/trailing space between properties in your `css` and `styled` blocks is removed. This can reduce the size of your final bundle.
16
16
17
-
### Dead Code Elimination
17
+
####Dead Code Elimination
18
18
19
19
Uglifyjs will use the injected `/*#__PURE__*/` flag comments to mark your `css` and `styled` blocks as candidates for dead code elimination.
20
20
21
-
### Source Maps
21
+
####Source Maps
22
22
23
23
When enabled, navigate directly to the style declaration in your javascript file.
24
24
25
-
### Components as selectors
25
+
####Components as selectors
26
26
27
27
The ability to refer to another component to apply override styles depending on nesting context. Learn more in the [styled docs](/docs/styled.mdx#targeting-another-emotion-component).
> A curated list of awesome stuff related to Emotion.
6
+
7
+
## Contents
8
+
9
+
-[Libraries](#libraries)
10
+
-[Component Libraries](#component-libraries)
11
+
-[Examples In the Wild](#examples-in-the-wild)
12
+
13
+
## Libraries
14
+
15
+
-[facepaint](https://github.com/emotion-js/facepaint) - Responsive style values for css-in-js
16
+
-[ember-emotion](https://github.com/alexlafroscia/ember-emotion) - Use emotion in Ember.js
17
+
-[vue-emotion](https://github.com/egoist/vue-emotion) - Use emotion in Vue.js
18
+
-[CSS to emotion transform](https://transform.now.sh/css-to-emotion/)
19
+
-[ShevyJS](https://github.com/kyleshevlin/shevyjs) - Configurable Vertical Rhythm & Typography in CSS-in-JS
20
+
-[design-system-utils](https://github.com/mrmartineau/design-system-utils) - Utilities to give better access to your design system.
21
+
-[styled-map](https://github.com/scf4/styled-map) - Super simple lib to map props to styles
22
+
-[polished](https://github.com/styled-components/polished) - Lightweight set of Sass/Compass-style mixins/helpers for writing styles in JavaScript
23
+
-[styled-conditions](https://github.com/karolisgrinkevicius/styled-conditions) - Ultra-lightweight flag utility to conditionally apply css depending on React props
24
+
-[manipulative](https://github.com/paulshen/manipulative) - React devtool to style emotion components from the browser
25
+
-[emotion-tailwind-preflight](https://github.com/flogy/emotion-tailwind-preflight) - Merge the shiny TailwindCSS base styles into your CSS-in-JS project
Copy file name to clipboardexpand all lines: docs/emotion-11.mdx
+10-9
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: 'Emotion 11'
4
4
5
5
Emotion 11 is a slight evolution over the Emotion 10. It focuses mainly on the developer experience, TS types improvements, switches internals to hooks and to the new version of the parser that we use: [Stylis](https://github.com/thysultan/stylis.js).
6
6
7
-
# Package renaming
7
+
##Package renaming
8
8
9
9
One of the most significant changes is that most of the user-facing packages have been renamed.
10
10
@@ -16,6 +16,7 @@ Most of this renaming can be done automatically via a codemod, following these s
16
16
1. Run `eslint` with the `--fix` flag. For example: `yarn eslint --config .eslintrc --ext .js,.jsx "." --fix`
17
17
18
18
The full list of renamed packages:
19
+
19
20
-`@emotion/core` → `@emotion/react`
20
21
-`emotion` → `@emotion/css`
21
22
-`emotion-theming` → moved into ` @emotion/react`
@@ -26,13 +27,13 @@ The full list of renamed packages:
Use hooks internally for improved bundle size and a better tree in React DevTools 🎉.
32
33
33
-
# TypeScript
34
+
##TypeScript
34
35
35
-
## Types overhaul
36
+
###Types overhaul
36
37
37
38
TypeScript types have been significantly restructured.
38
39
@@ -45,7 +46,7 @@ TypeScript types have been significantly restructured.
45
46
46
47
If you encounter build issues after upgrade, try removing any manually specified generic types and let them be inferred.
47
48
48
-
## Theme type
49
+
###Theme type
49
50
50
51
It's now easier to provide a type for `Theme`. Instead of creating custom instances (like before) you can augment the builtin `Theme` interface like this:
The way in which we provide TypeScript support for the `css` prop has changed. Based on the usage of our JSX factories, we can add support for `css` prop only for components that support `className` prop (as our JSX factory functions take the provided `css` prop, resolve it and pass the generated `className` to the rendered component).
66
67
@@ -76,7 +77,7 @@ However, if you are stuck with older version of TypeScript or using the classic
76
77
77
78
In this particular case we are forced to extend the existing `React.Attributes` interface. Previously we've been extending both `React.DOMAttributes` and `JSX.IntrinsicAttributes`. This change is really minor and shouldn't affect any consuming code.
78
79
79
-
# Stylis v4
80
+
##Stylis v4
80
81
81
82
The parser we use ([Stylis](https://github.com/thysultan/stylis.js)) got upgraded. It fixes some long-standing parsing edge cases while being smaller and faster 🚀
82
83
@@ -87,13 +88,13 @@ It has been completely rewritten and comes with some breaking changes. The most
87
88
- the prefixer is now just a plugin which happens to be included in the default `stylisPlugins`. If you plan to use custom `stylisPlugins` and you want to have your styles prefixed automatically you must include prefixer in your custom `stylisPlugins`. You can import `prefixer` from the `stylis` module to do that.
88
89
-`@import` rules are no longer special-cased. The responsibility to put them first has been moved to the author of the styles. They also can't be nested within other rules now. It's only possible to write them at the top level of global styles.
89
90
90
-
# Emotion's caches
91
+
##Emotion's caches
91
92
92
93
The `key` option is now required when creating a custom instance of a cache. Please make sure it's unique (and not equal to `'css'`) as it's used for linking styles to your cache. If multiple caches share the same key they might "fight" for each other's style elements.
93
94
94
95
The new `prepend` option can make Emotion add style tags at the beginning of the specified DOM container instead of the end.
95
96
96
-
# Other
97
+
##Other
97
98
98
99
There are a lot of less substantial changes than what has been described here, some of them might even be breaking changes but are not relevant to the majority of users. Therefore to learn more about all of the changes please read through the full list of changes contained in the respective changelogs:
0 commit comments