-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements for theme color CSS variables (#229)
* Set light theme CSS variables as default * Scope theme color CSS variables * Doc * 0.9.1 * Update assets dependencies
- Loading branch information
1 parent
2a4f8dd
commit 61f8f50
Showing
20 changed files
with
1,256 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
{ | ||
"name": "primer-live", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "JavaScript and CSS for PrimerLive", | ||
"license": "MIT", | ||
"repository": {}, | ||
"scripts": { | ||
"build": "tsx scripts/build.ts", | ||
"post-process-scoped-css": "tsx scripts/post-process-scoped-css.ts", | ||
"pre-process-light-theme-css": "tsx scripts/pre-process-light-theme-css.ts", | ||
"build:types": "./node_modules/typescript/bin/tsc --p tsconfig.gen.json" | ||
}, | ||
"dependencies": { | ||
"@primer/css": "21.5.0", | ||
"@primer/view-components": "^0.34.0", | ||
"@types/phoenix_live_view": "^0.18.5", | ||
"fs": "^0.0.1-security", | ||
"prettier": "^3.3.3", | ||
"prettier": "^3.4.2", | ||
"yargs": "^17.7.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^22.4.1", | ||
"@types/node": "^22.10.2", | ||
"@types/yargs": "^17.0.33", | ||
"esbuild": "^0.23.1", | ||
"esbuild": "^0.24.2", | ||
"esbuild-sass-plugin": "^3.3.1", | ||
"tsx": "^4.17.0", | ||
"typescript": "^5.5.4" | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.7.2" | ||
}, | ||
"author": "Arthur Clemens <[email protected]> (http://arthurclemens.com)" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
import { join } from "path"; | ||
import { getCssText, storeCssText } from "./shared" | ||
|
||
const ORIGIN_PATH = "assets/node_modules/@primer/primitives/dist/css/functional/themes/light.css" | ||
const DESTINATION_PATH = "assets/css/gen-themes-light.css" | ||
|
||
const relativeOriginPath = join("../", ORIGIN_PATH); | ||
const relativeDestinationPath = join("../", DESTINATION_PATH); | ||
|
||
async function processFile( | ||
originPath: string, | ||
destinationPath: string | ||
) { | ||
|
||
let text = getCssText(originPath); | ||
text = ` | ||
:root, | ||
${text}`; | ||
|
||
storeCssText(destinationPath, text); | ||
} | ||
|
||
processFile(relativeOriginPath, relativeDestinationPath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as fs from "fs"; | ||
|
||
export function getCssText(path: string) { | ||
return fs | ||
.readFileSync(path, { | ||
encoding: "utf8", | ||
flag: "r", | ||
}) | ||
.toString(); | ||
} | ||
|
||
export function storeCssText(path: string, data: string) { | ||
fs.writeFileSync(path, data, { | ||
flag: "w", | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.