Skip to content

Commit a105034

Browse files
chore: export theme red by default
1 parent 44865c6 commit a105034

File tree

6 files changed

+9
-24
lines changed

6 files changed

+9
-24
lines changed

@codexteam/ui/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ import '@codexteam/ui/styles/themes/grass';
4747

4848
**Available themes:** `graphite`, `crimson`, `red`, `violet`, `grass`, `amber`, `pure`, `sky`
4949

50+
> **Note:** the **red** theme is included to the library out of the box since it is used for destructive-action styles.
51+
> You don't need to import **@codexteam/ui/styles/themes/red** manually in your app.
52+
5053
### 4. Import Components (Tree-shakeable)
5154

5255
```typescript

@codexteam/ui/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codexteam/ui",
3-
"version": "0.2.0-rc.4",
3+
"version": "0.2.0-rc.5",
44
"type": "module",
55
"sideEffects": [
66
"*.css",
@@ -36,12 +36,6 @@
3636
"./styles/themes/crimson": {
3737
"import": "./dist/styles/themes/crimson.css"
3838
},
39-
"./styles/themes/red": {
40-
"import": "./dist/styles/themes/red.css"
41-
},
42-
"./styles/themes/red.css": {
43-
"import": "./dist/styles/themes/red.css"
44-
},
4539
"./styles/themes/violet": {
4640
"import": "./dist/styles/themes/violet.css"
4741
},

@codexteam/ui/src/styles/index.pcss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
@import './typography.pcss';
33
@import './mixins.pcss';
44
@import './z-axis.pcss';
5+
/**
6+
* Import 'red' theme by default since it is used for desctructive-action styles
7+
*/
8+
@import './themes/red.pcss';

@codexteam/ui/src/vue/components/button/Button.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
import { computed, defineProps, useSlots } from 'vue';
2626
import Icon from '../icon/Icon.vue';
2727
28-
/**
29-
* Red theme for destructive styles (auto-included, no manual import required by consumers).
30-
*/
31-
import '@codexteam/ui/styles/themes/red.css';
32-
3328
const props = withDefaults(
3429
defineProps<{
3530
/**

@codexteam/ui/vite.config.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export default defineConfig({
5656
*/
5757
'styles/themes/graphite': resolve(__dirname, 'src/styles/themes/graphite.pcss'),
5858
'styles/themes/crimson': resolve(__dirname, 'src/styles/themes/crimson.pcss'),
59-
'styles/themes/red': resolve(__dirname, 'src/styles/themes/red.pcss'),
6059
'styles/themes/violet': resolve(__dirname, 'src/styles/themes/violet.pcss'),
6160
'styles/themes/grass': resolve(__dirname, 'src/styles/themes/grass.pcss'),
6261
'styles/themes/amber': resolve(__dirname, 'src/styles/themes/amber.pcss'),
@@ -78,22 +77,13 @@ export default defineConfig({
7877
preserveModules: true,
7978
preserveModulesRoot: 'src',
8079
},
81-
// make sure to externalize deps that shouldn't be bundled
82-
// into your library
80+
// make sure to externalize deps that shouldn't be bundled into your library
8381
external: [
8482
'vue',
8583
'@vueuse/core',
8684
'@vueuse/shared',
8785
'@editorjs/editorjs',
8886
'@codexteam/icons',
89-
/**
90-
* Mark the red theme as external because it's imported inside the UI library itself (used for destructive buttons)
91-
* This prevents Rollup from trying to bundle/resolve @codexteam/ui/styles/themes/red as an internal module.
92-
* It also avoids Rollup silencing the "failed to resolve import" error.
93-
* The actual CSS file is still emitted separately via the styles/themes/red CSS entry in rollupOptions.input.
94-
*/
95-
'@codexteam/ui/styles/themes/red',
96-
'@codexteam/ui/styles/themes/red.css',
9787
],
9888
},
9989
},

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import '@codexteam/ui/styles/themes/graphite';
1010
import '@codexteam/ui/styles/themes/sky';
1111
import '@codexteam/ui/styles/themes/crimson';
1212
import '@codexteam/ui/styles/themes/grass';
13-
import '@codexteam/ui/styles/themes/red';
1413
import '@codexteam/ui/styles/themes/violet';
1514
import '@codexteam/ui/styles/themes/amber';
1615
import '@codexteam/ui/styles/themes/pure';

0 commit comments

Comments
 (0)