zeus-css 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/bin/init.js +17 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -77,7 +77,7 @@ $zeus-colors: (
77
77
  Then compile `zeus.theme.scss` and link **that** output instead of `zeus-css/dist/zeus.css`:
78
78
 
79
79
  ```bash
80
- sass --load-path=node_modules zeus.theme.scss zeus.theme.css
80
+ sass zeus.theme.scss zeus.theme.css
81
81
  ```
82
82
 
83
83
  Re-run this command after any edit to `zeus.config.scss` / `zeus.customize.scss`. Running `npx zeus-css init` again never overwrites files you already have.
package/bin/init.js CHANGED
@@ -100,6 +100,18 @@ try {
100
100
  $zeus-button-variants: localCustomize.$zeus-button-variants
101
101
  `;
102
102
 
103
+ // Relative path from the project root to this package's own scss/ files.
104
+ // A bare "zeus-css/..." specifier only resolves via npm-aware tooling
105
+ // (bundler resolution, or `sass --load-path=node_modules`) — computing a
106
+ // real relative path instead also works for someone who just downloaded
107
+ // this folder (no npm, no node_modules) and compiles with plain `sass`,
108
+ // and is no worse for the normal npm case since __dirname already points
109
+ // at wherever npm/pnpm/yarn actually resolved this package on disk.
110
+ const packageRoot = path.join(__dirname, '..');
111
+ const toPosix = (p) => p.split(path.sep).join('/');
112
+ const zeusBridgeRelPath = toPosix(path.relative(projectRoot, path.join(packageRoot, 'scss', 'zeus.scss')));
113
+ const zeusFoundationRelPath = toPosix(path.relative(projectRoot, path.join(packageRoot, 'scss', 'foundation', 'foundation.scss')));
114
+
103
115
  // 2. Generate the Bridge file — configured tokens/mixins/functions for
104
116
  // .module.scss files. Emits zero CSS on its own (see zeus-css/scss/zeus.scss).
105
117
  const bridgeContent = `// ╔══════════════════════════════════════════════════════════════╗
@@ -116,10 +128,10 @@ try {
116
128
  @use "./zeus.config.scss" as localConfig;
117
129
  @use "./zeus.customize.scss" as localCustomize;
118
130
 
119
- @use "zeus-css/scss/zeus.scss" with (${configArgs});
131
+ @use "${zeusBridgeRelPath}" with (${configArgs});
120
132
 
121
133
  // Expose the configured framework so you can import it elsewhere
122
- @forward "zeus-css/scss/zeus.scss";
134
+ @forward "${zeusBridgeRelPath}";
123
135
  `;
124
136
 
125
137
  writeIfMissing(
@@ -140,14 +152,14 @@ try {
140
152
  // precompiled zeus-css/dist/zeus.css always ships with the framework
141
153
  // defaults and never sees your local edits.
142
154
  //
143
- // sass --load-path=node_modules zeus.theme.scss zeus.theme.css
155
+ // sass zeus.theme.scss zeus.theme.css
144
156
  //
145
157
  // Then link zeus.theme.css instead of zeus-css/dist/zeus.css.
146
158
 
147
159
  @use "./zeus.config.scss" as localConfig;
148
160
  @use "./zeus.customize.scss" as localCustomize;
149
161
 
150
- @use "zeus-css/scss/foundation/foundation.scss" with (${configArgs});
162
+ @use "${zeusFoundationRelPath}" with (${configArgs});
151
163
  `;
152
164
 
153
165
  writeIfMissing(
@@ -185,7 +197,7 @@ declare module '*.scss';
185
197
  console.log('1. For component .module.scss files, use the bridge (no CSS emitted):');
186
198
  console.log(' @use "./zeus.scss" as *;');
187
199
  console.log('2. For your actual themed stylesheet, compile zeus.theme.scss and link its output instead of zeus-css/dist/zeus.css:');
188
- console.log(' sass --load-path=node_modules zeus.theme.scss zeus.theme.css');
200
+ console.log(' sass zeus.theme.scss zeus.theme.css');
189
201
  console.log('3. Edit zeus.config.scss or zeus.customize.scss and recompile to update the framework globally.');
190
202
  } catch (e) {
191
203
  console.error('❌ Failed to extract Zeus config files', e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeus-css",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "⚡ A Premium, Zero-Emission, Fluid-Scaling CSS Framework based on Sass SCSS Engine",
5
5
  "author": "Stavros Lazaris",
6
6
  "license": "MIT",