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 consistent palette between variants #84

Merged
merged 4 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions icons/rose-pine-icon-theme.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"iconDefinitions": {
"_file": {
"iconPath": "./file.svg"
},
"_file-special": {
"iconPath": "./file-special.svg"
},
"_folder": {
"iconPath": "./folder.svg"
},
"_folder-open": {
"iconPath": "./folder-open.svg"
}
},
"file": "_file",
"fileNames": {
"_pinecone-color-theme.json": "_file-special",
"pinecone.config.js": "_file-special"
},
"folder": "_folder",
"folderExpanded": "_folder-open",
"hidesExplorerArrows": true
"iconDefinitions": {
"_file": {
"iconPath": "./file.svg"
},
"_file-special": {
"iconPath": "./file-special.svg"
},
"_folder": {
"iconPath": "./folder.svg"
},
"_folder-open": {
"iconPath": "./folder-open.svg"
}
},
"file": "_file",
"fileNames": {
"_pinecone-color-theme.json": "_file-special",
"pinecone.config.js": "_file-special"
},
"folder": "_folder",
"folderExpanded": "_folder-open",
"hidesExplorerArrows": true
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"scripts": {
"build": "pinecone",
"watch": "pinecone --watch",
"release": "np --no-publish --no-tests"
"format": "prettier --write .",
"release": "np --no-publish --no-tests",
"version": "npm run build && npm run format"
},
"icon": "assets/icon.png",
"displayName": "Rosé Pine",
Expand Down Expand Up @@ -84,7 +86,7 @@
"devDependencies": {
"@rose-pine/palette": "^2.0.0-4",
"np": "^7.6.1",
"pinecone-cli": "^3.0.1",
"pinecone-cli": "^4.0.0",
"prettier": "^2.5.1"
},
"prettier": {
Expand Down
59 changes: 17 additions & 42 deletions pinecone.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
import { colorish, defineConfig } from 'pinecone-cli'
import { roles } from '@rose-pine/palette'

const colors = {}
const palette = {}
Object.keys(roles).map((role) => {
const currentRole = roles[role]

colors[role] = {
main: currentRole.main.alpha
? currentRole.main.alpha.hex
: currentRole.main.hex,
moon: currentRole.moon.alpha
? currentRole.moon.alpha.hex
: currentRole.moon.hex,
dawn: currentRole.dawn.alpha
? currentRole.dawn.alpha.hex
: currentRole.dawn.hex,
// Add Rosé Pine palette.
palette[role] = {
main: currentRole.main.alpha?.hex ?? currentRole.main.hex,
moon: currentRole.moon.alpha?.hex ?? currentRole.moon.hex,
dawn: currentRole.dawn.alpha?.hex ?? currentRole.dawn.hex,
}

colors[`${role}Muted`] = {
// Add translucent variations.
palette[`${role}/50`] = {
main: colorish(currentRole.main.hex, 0.5),
moon: colorish(currentRole.moon.hex, 0.5),
dawn: colorish(currentRole.dawn.hex, 0.5),
}

colors[`${role}15`] = {
palette[`${role}/15`] = {
main: colorish(currentRole.main.hex, 0.15),
moon: colorish(currentRole.moon.hex, 0.15),
dawn: colorish(currentRole.dawn.hex, 0.15),
Expand Down Expand Up @@ -52,37 +47,17 @@ export default defineConfig({
},
},
colors: {
shadow: colorish(palette.surface, 0.3),
transparent: '#0000',
unusedOpacity: colorish('#000', 0.5),

primary: colors.rose,
primaryHover: colorish(colors.rose, 0.9),
onPrimary: colors.base,

secondary: colors.iris,
secondaryHover: colorish(colors.iris, 0.9),
onSecondary: colors.base,

neutral: colors.surface,
neutralHover: colors.overlay,
onNeutral: colors.text,

shadow: {
main: colorish('#010101', 0.1),
moon: colorish('#191724', 0.3),
dawn: colorish('#f2e9de', 0.3),
},

diffHighlightInserted: colors.foam15,
diffHighlightRemoved: colors.love15,

icon: colors.subtle,
iconActive: colors.text,
onPrimary: palette.base,
primary: palette.rose,
primaryHover: colorish(palette.rose, 0.9),

information: colors.foam,
warning: colors.gold,
error: colors.love,
onSecondary: palette.base,
secondary: palette.iris,
secondaryHover: colorish(palette.iris, 0.9),

...colors,
...palette,
},
})
Loading