4.0.8 • Published 1 month ago

@leafygreen-ui/emotion v4.0.8

Weekly downloads
3,745
License
Apache-2.0
Repository
github
Last release
1 month ago

Emotion

npm (scoped)

Installation

Yarn

yarn add @leafygreen-ui/emotion

NPM

npm install @leafygreen-ui/emotion

Server-side Rendering

Because we use a custom instance of Emotion to allow for styles defined in LeafyGreen to be easily overwritten, there's an additional step that must be taken to use our components when performing server-side rendering.

We expose three methods as named exports that are also exposed by the base emotion-server package: renderStylesToString, renderStylesToNodeStream, and extractCritical. You can find documentation on usage of each of the methods in the official Emotion documentation.

NOTE: If you are already server-side rendering an application using Emotion, you will use the methods exposed in @leafygreenui/emotion instead of, NOT in addition to the methods exposed by emotion-server.

Example

import { renderToString } from 'react-dom/server';
import { renderStylesToString } from '@leafygreen-ui/emotion';
import App from './App';

const html = renderStylesToString(renderToString(<App />));
@everything-registry/sub-chunk-539@leafygreen-ui/inline-definition@infinitebrahmanuniverse/nolb-_lea@leafygreen-ui/number-input@leafygreen-ui/pagination@leafygreen-ui/password-input@leafygreen-ui/pipeline@leafygreen-ui/popover@leafygreen-ui/radio-box-group@leafygreen-ui/radio-group@leafygreen-ui/search-input@leafygreen-ui/segmented-control@leafygreen-ui/select@leafygreen-ui/side-nav@leafygreen-ui/skeleton-loader@leafygreen-ui/split-button@leafygreen-ui/stepper@leafygreen-ui/table@leafygreen-ui/tabs@leafygreen-ui/text-area@leafygreen-ui/text-input@leafygreen-ui/toast@leafygreen-ui/toggle@leafygreen-ui/tooltip@leafygreen-ui/typography@leafygreen-ui/input-option@leafygreen-ui/interaction-ring@leafygreen-ui/loading-indicator@leafygreen-ui/logo@leafygreen-ui/marketing-modal@leafygreen-ui/menu@leafygreen-ui/modal@leafygreen-ui/mongo-nav@laffygreen-ui/cancel-button@laffygreen-ui/date-picker@laffygreen-ui/morse-input@laffygreen-ui/name-input@laffygreen-ui/number-input@lg-chat/avatar@lg-chat/chat-disclaimer@lg-chat/chat-window@lg-chat/fixed-chat-window@lg-chat/input-bar@leafygreen-ui/a11y@leafygreen-ui/badge@leafygreen-ui/banner@leafygreen-ui/brand-shape@leafygreen-ui/button@leafygreen-ui/callout@leafygreen-ui/card@leafygreen-ui/checkbox@leafygreen-ui/chip@leafygreen-ui/code@leafygreen-ui/combobox@leafygreen-ui/confirmation-modal@leafygreen-ui/copyable@leafygreen-ui/date-picker@leafygreen-ui/empty-state@leafygreen-ui/expandable-card@leafygreen-ui/form-field@leafygreen-ui/form-footer@leafygreen-ui/guide-cue@leafygreen-ui/icon@leafygreen-ui/icon-button@leafygreen-ui/info-sprinkle@lg-chat/lg-markdown@lg-chat/message@lg-chat/message-feed@lg-chat/message-feedback@lg-chat/message-prompts@lg-chat/message-rating@lg-chat/title-bar@lg-tools/storybook-decorators@mongodb-js/compass-components
4.0.8

1 month ago

5.0.0-alpha.1

10 months ago

5.0.0-alpha.0

10 months ago

4.0.5

10 months ago

4.0.7

9 months ago

4.0.6

9 months ago

4.0.4

1 year ago

4.0.3

2 years ago

4.0.2

2 years ago

4.0.2-test.0

2 years ago

4.0.1

2 years ago

4.0.2-next.1

2 years ago

4.0.2-next.0

2 years ago

4.0.2-next.2

2 years ago

4.0.0

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago