{"id":26552753,"url":"https://github.com/codex-/storybook-mui-classname-generator-issue","last_synced_at":"2026-04-02T04:48:03.052Z","repository":{"id":198099029,"uuid":"700042233","full_name":"Codex-/storybook-mui-classname-generator-issue","owner":"Codex-","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-03T22:33:15.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-10-04T12:11:25.153Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Codex-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-03T20:41:50.000Z","updated_at":"2023-10-04T12:11:26.466Z","dependencies_parsed_at":null,"dependency_job_id":"025d8d99-2a62-4400-b814-acbfe3ecee64","html_url":"https://github.com/Codex-/storybook-mui-classname-generator-issue","commit_stats":null,"previous_names":["codex-/storybook-mui-classname-generator-issue"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fstorybook-mui-classname-generator-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fstorybook-mui-classname-generator-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fstorybook-mui-classname-generator-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fstorybook-mui-classname-generator-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codex-","download_url":"https://codeload.github.com/Codex-/storybook-mui-classname-generator-issue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931591,"owners_count":20534011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-22T08:49:27.651Z","updated_at":"2025-12-30T20:45:18.728Z","avatar_url":"https://github.com/Codex-.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Storybook MUI custom classname generation issue\n\n- 📄 Discussion: \u003chttps://github.com/storybookjs/storybook/discussions/24350\u003e\n\nThis repository exists to demonstrate an issue when using [MUIs ClassName generator customisation](https://mui.com/material-ui/experimental-api/classname-generator/) with storybook.\n\n## Issue\n\nWhen viewing storybook stories via statically generated builds, the import order within `preview.tsx` is not respected, which in the case of MUI classname customisation causes styling and clasname operations to happen out of order resulting in mixed styles.\n\nThe storybook static builds work correctly if the import that customises the Mui ClassName generation is disabled:\n\n`preview.tsx`\n\n```tsx\nimport \"./MuiClassNameSetup\"; // Comment this line out to 'fix' storybook static builds\n```\n\n### Expected\n\nHere we can see the expected styles being applied correctly, which can be seen when running storybook via `npm run storybook`\n\n![Expected](docs/expected.png)\n\n### Actual\n\nThis is the rendered content looks like when serving the statically generated builds which can be seen via `npm run storybook:static`\n\n![Actual](docs/actual.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-%2Fstorybook-mui-classname-generator-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-%2Fstorybook-mui-classname-generator-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-%2Fstorybook-mui-classname-generator-issue/lists"}