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

use modularized fluent #12199

Closed
zerofront opened this issue Mar 5, 2020 · 6 comments
Closed

use modularized fluent #12199

zerofront opened this issue Mar 5, 2020 · 6 comments
Assignees
Labels

Comments

@zerofront
Copy link

Environment Information

  • Package version(s): Library: Fluent-ui-react
  • Browser and OS versions: latest

Please provide a reproduction of the bug in a codepen:

I want to use modularized fluent-ui

import { Box, Provider, themes } from '@fluentui/react'

I only need Box Component, but there are many other components In theme Object
like AvatarStyles、DialogStyles tec

Actual behavior:

in fluent-ui source code

export const themes = { fontAwesome, teams, teamsDark, teamsHighContrast };

Expected behavior:

what can I do if I only need teams themes?
what can I do if I only need some Components?

Priorities and help requested:

Are you willing to submit a PR to fix? (Yes, No)

Requested priority: High

Products/sites affected: Consumers should not be penalized for code they don't use (through bundle size, perf, etc).

@aneeshack4
Copy link
Contributor

Hi @zerofront, there's documentation & example code on the Fluent site about the case when you want to import just a few components & use the teams theme - is this what you're looking for? https://fluentsite.z22.web.core.windows.net/theming-examples

@zerofront
Copy link
Author

Hi @aneeshack4 , Thank you for your prompt reply

import React from 'react'
import { Button, Icon, Label, Provider, themes } from '@fluentui/react'

export default () => (
  <Provider theme={themes.teams}>
    <Button content="Button" />
    <Button icon="add" iconOnly primary />
    <Button icon="email" content="Send email" secondary />
    <Icon name="emoji" size="larger" />
    <Label content="Label with icon" icon="close" />
  </Provider>
)

For this example, I just want to import Button、icon、Label Component,but in theme object, therer are many style of other component which is unnecessary。

@layershifter
Copy link
Member

@zerofront I opened #12224 to fix broken exports.

Future items:

@xugao
Copy link
Contributor

xugao commented Jul 16, 2020

@layershifter - doing some housekeep here. do you think we need to leave this issue open or can be closed?

@layershifter
Copy link
Member

@xugao I think that we can close this as a duplicate and keep #12953.

@jurokapsiar
Copy link
Contributor

Duplicate of #12953

@jurokapsiar jurokapsiar marked this as a duplicate of #12953 Aug 10, 2020
@microsoft microsoft locked as resolved and limited conversation to collaborators Sep 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants