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

feat: Use default tag theme props if provided #334

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

csandman
Copy link
Owner

@csandman csandman commented Sep 19, 2024

This PR removed the default value provided for the tagColorScheme prop in favor of using whatever color scheme the user has provided to their base Chakra theme. It does the same for the base variant provided.

With the following theme code:

const tagTheme = extendTheme({
  components: {
    Tag: defineStyleConfig({
      defaultProps: {
        colorScheme: "blue",
        variant: "solid",
      },
    }),
  },
});

const App: NextPage = () => (
  <ChakraProvider theme={tagTheme}>
    <FormControl>
      <FormLabel>Multi with custom tag theme</FormLabel>
      <Select
        isMulti
        options={groupedOptions}
      />
    </FormControl>
  </ChakraProvider>
);

The output was rendered with the proper theme styles:

image

Copy link

github-actions bot commented Sep 19, 2024

📊 Package size report   0.8%↑

File Before After
dist/index.js 16.4 kB 2%↑16.7 kB
dist/index.js.map 73.3 kB 1%↑74.1 kB
dist/index.mjs 15.0 kB 2%↑15.2 kB
dist/index.mjs.map 73.3 kB 1%↑74.1 kB
Total (Includes all files) 269.5 kB 0.8%↑271.6 kB
Tarball size 60.1 kB 0.9%↑60.7 kB
Unchanged files
File Size
dist/index.d.mts 19.9 kB
dist/index.d.ts 19.9 kB
LICENSE.md 1.1 kB
package.json 2.9 kB
README.md 47.6 kB

🤖 This report was automatically generated by pkg-size-action

@csandman csandman merged commit af4dd7b into v5 Sep 19, 2024
2 checks passed
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.

2 participants