Giter Site home page Giter Site logo

rose-pine / palette Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 2.0 134 KB

Color palette tool for Rosé Pine

Home Page: https://www.npmjs.com/package/@rose-pine/palette

License: MIT License

JavaScript 38.37% TypeScript 61.63%
palette soho-vibes rose-pine color css

palette's Introduction

Rosé Pine Palette

All natural pine, faux fur and a bit of soho vibes for the classy minimalist

Color palette tool for Rosé Pine

Usage

CSS variables

Media

See dist/css/rose-pine-media{-rgb,-hsl}.css

Useful for light/dark theming. Values follow the user's system theme, using the dawn variant when light and main variant when dark. Moon values can be uncommented and used instead.

Classes

See dist/css/rose-pine-class{-rgb,-hsl}.css

Useful for theming with more than two options. Values are set based on a wrapping class of .theme-rp{-moon,-dawn}.

body {
	color: var(--rp-text);
	background: var(--rp-base);
}

Static

See dist/css/rose-pine{-rgb,-hsl}.css

Useful when flexibility is desired. Values include their variant's name for moon and dawn, allowing all variants to be individually referenced.

.link-main {
	color: var(--rp-iris);
}
.link-moon {
	color: var(--rp-moon-iris);
}
.link-dawn {
	color: var(--rp-dawn-iris);
}

Tailwind CSS

Preset configuration

See dist/tailwind/rose-pine{-media}.js

// tailwind.config.js
module.exports = {
	presets: [require("./rose-pine.js")],
};

If using rose-pine-media.js, see the section below to include the necessary CSS variables.

CSS variables

See dist/css/rose-pine-media-tailwind.css

This method sets CSS variables to raw HSL values to support alpha values in classes, e.g. bg-rose/50.

JavaScript

Starting with v4, colour values are unformatted. Formatted values can be found in our dist folder. For creating new themes, it is recommended to use our build tool.

import {variants, roles} from "@rose-pine/palette";

variants.moon.colors.highlightLow.hsl
// => [245, 22, 20]

variants.moon.colors.highlightLow.alpha.hsl
// => [249, 14%, 55%, 0.08]

variants.main.id
// => rose-pine

variants.moon.key
// => moon

variants.dawn.name
// => Rosé Pine Dawn

roles.base.colors.main.hex
// => '191724'

roles.surface.colors.dawn.rgb
// => [255, 250, 243]

roles.highlightLow.id
// => highlight-low

roles.highlightMed.key
// => highlightMed

roles.highlightHigh.name
// => Highlight High

Specification

Variants

Rosé Pine includes three variants. These are referenced as Rosé Pine, Rosé Pine Moon, and Rosé Pine Dawn. Their codenames are main, moon, and dawn respectively. Naming does not include "main" unless necessary. When used as file names, prefer snake-case. E.g. rose-pine, rose-pine-moon, and rose-pine-dawn.

Roles

Neutral

Role Description Usage
base Primary background inactive tabs, sidebars
surface Low contrast background atop base text inputs, panels
overlay Medium contrast background atop surface text inputs, panels, active tabs
muted Low contrast foreground comments, git ignored
subtle Medium contrast foreground non-selected results, inactive tabs, punctuation, operators
text High contrast foreground cursor text, selected results, selection foreground (paired with highlightMed background), active tabs, variables
highlightLow Low contrast highlight cursor line
highlightMed Medium contrast highlight selection background (paired with text foreground)
highlightHigh High contrast highlight cursor background, borders

Accent

Role Usage
love terminal red, builtins, errors, git delete
gold terminal yellow, strings, warnings
rose terminal cyan, booleans, git change, git dirty, git text
pine terminal green, functions, git rename
foam terminal blue, object keys, info, git add
iris terminal magenta, parameters, links, hints, git merge, git stage

Related

palette's People

Contributors

barelyhuman avatar fvrests avatar mvllow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

palette's Issues

RFC: API discussion

The v2 preview includes a simplified API over v1. If anyone has suggestions or requested changes towards this new API please discuss so here.

We are using a string-friendly representation of our palette, eg. 'rgb(0, 0, 0)' instead of a considered alternative of [0, 0, 0]. I'm unsure if having multiple formats would be beneficial in the official package or that would be bloat for most use cases.

Finally, before we publish a stable release, we would like to implement https://github.com/barelyhuman/rose-pine-css into this package 😌

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.