Skip to content

Commit

Permalink
feat!: update palette and variant names (#10)
Browse files Browse the repository at this point in the history
* docs: use cdn images

* feat!: update palette & rename `core` to `main`

* chore: update metadata

* docs: update usage example
  • Loading branch information
mvllow committed Feb 4, 2023
1 parent 29c1502 commit 59f85c6
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 61 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
Binary file removed assets/palette.png
Binary file not shown.
Binary file removed assets/preview-dawn.png
Binary file not shown.
Binary file removed assets/preview-moon.png
Binary file not shown.
Binary file removed assets/preview.png
Binary file not shown.
65 changes: 30 additions & 35 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,74 @@
const variants = {
/**
* @deprecated Renamed to `core`
*/
base: {
main: {
base: "#191724",
surface: "#1f1d2e",
overlay: "#26233a",
inactive: "#555169",
subtle: "#6e6a86",
muted: "#6e6a86",
subtle: "#908caa",
text: "#e0def4",
love: "#eb6f92",
gold: "#f6c177",
rose: "#ebbcba",
pine: "#31748f",
foam: "#9ccfd8",
iris: "#c4a7e7",
highlight: "#2a2837",
},
core: {
base: "#191724",
surface: "#1f1d2e",
overlay: "#26233a",
inactive: "#555169",
subtle: "#6e6a86",
text: "#e0def4",
love: "#eb6f92",
gold: "#f6c177",
rose: "#ebbcba",
pine: "#31748f",
foam: "#9ccfd8",
iris: "#c4a7e7",
highlight: "#2a2837",
highlightLow: "#21202e",
highlightMed: "#403d52",
highlightHigh: "#524f67",
},
moon: {
base: "#232136",
surface: "#2a273f",
overlay: "#393552",
inactive: "#59546d",
subtle: "#817c9c",
muted: "#6e6a86",
subtle: "#908caa",
text: "#e0def4",
love: "#eb6f92",
gold: "#f6c177",
rose: "#ea9a97",
pine: "#3e8fb0",
foam: "#9ccfd8",
iris: "#c4a7e7",
highlight: "#312f44",
highlightLow: "#2a283e",
highlightMed: "#44415a",
highlightHigh: "#56526e",
},
dawn: {
base: "#faf4ed",
surface: "#fffaf3",
overlay: "#f2e9de",
inactive: "#9893a5",
subtle: "#6e6a86",
muted: "#9893a5",
subtle: "#797593",
text: "#575279",
love: "#b4637a",
gold: "#ea9d34",
rose: "#d7827e",
pine: "#286983",
foam: "#56949f",
iris: "#907aa9",
highlight: "#eee9e6",
highlightLow: "#f4ede8",
highlightMed: "#dfdad9",
highlightHigh: "#cecacd",
},
};

const variantNames = ["main", "moon", "dawn"];

exports.decorateConfig = (config) => {
const variant = (config.theme && config.theme.variant) || "core";
const variant =
(config.theme &&
variantNames.includes(config.theme.variant) &&
config.theme.variant) ||
"main";
const palette = variants[variant];

if (
config.theme &&
config.theme &&
Object.keys(config.theme).includes(variant) &&
typeof config.theme[variant] === 'object'
) {
typeof config.theme[variant] === "object"
) {
for (const param of Object.keys(config.theme[variant])) {
palette[param] = config.theme[variant][param]
palette[param] = config.theme[variant][param];
}
}

Expand All @@ -101,8 +95,9 @@ exports.decorateConfig = (config) => {
padding: config.padding || "12px 30px 30px 30px",
backgroundColor: palette.base,
foregroundColor: palette.text,
cursorColor: palette.inactive,
selectionColor: palette.highlight,
cursorColor: palette.highlightHigh,
cursorAccentColor: palette.text,
selectionColor: palette.highlightMed,
borderColor: "#0000",
css: `
.tab_text { color: ${palette.subtle} }
Expand Down
30 changes: 12 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
{
"name": "hyper-rose-pine",
"version": "2.2.0",
"description": "All natural pine, faux fur and a bit of soho vibes for the classy minimalist.",
"description": "All natural pine, faux fur and a bit of soho vibes for the classy minimalist",
"license": "MIT",
"files": [
"index.js"
],
"repository": "rose-pine/hyper",
"funding": "https://github.com/rose-pine/hyper?sponsor=1",
"author": "fvrests",
"scripts": {
"release": "npx np --no-publish --no-tests"
},
"files": [
"index.js"
],
"keywords": [
"hyper",
"hyper-theme",
"theme",
"ui",
"terminal",
"rose pine",
"minimal",
"aesthetic",
"pastel",
"classy",
"dark theme",
"subtle",
"minimalist",
"minimal"
],
"author": "fvrests",
"repository": {
"type": "git",
"url": "https://github.com/fvrests/hyper-rose-pine"
}
"soft"
]
}
21 changes: 13 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,26 @@ $ hyper i hyper-rose-pine

or

```js
```javascript
// ~/.hyper.js
plugins: ["hyper-rose-pine"],
```

## Options

```js
```javascript
config: {
theme: {
// Default: core
// Can be core, moon or dawn
// @usage 'main' | 'moon' | 'dawn'
// @default 'main'
variant: 'dawn',

// Optionally, override Rosé Pine palette per variant:
// https://rosepinetheme.com/palette
main: {},
moon: {},
dawn: {
inactive: '#DFFF00'
muted: '#dfff00'
}
}
}
Expand All @@ -43,12 +48,12 @@ config: {

**Rosé Pine**

![Hyper with Rosé Pine](assets/preview.png)
![Hyper with Rosé Pine](https://user-images.githubusercontent.com/1474821/216485794-402f4eac-7978-4846-bb6f-527078759b81.png)

**Rosé Pine Moon**

![Hyper with Rosé Pine Moon](assets/preview-moon.png)
![Hyper with Rosé Pine Moon](https://user-images.githubusercontent.com/1474821/216485807-dc3537e6-a716-415b-b314-1a21eb807fc5.png)

**Rosé Pine Dawn**

![Hyper with Rosé Pine Dawn](assets/preview-dawn.png)
![Hyper with Rosé Pine Dawn](https://user-images.githubusercontent.com/1474821/216485812-7f098984-e2cf-4ffd-973d-bec615a93128.png)

0 comments on commit 59f85c6

Please sign in to comment.