Git Product home page Git Product logo

cider2-rose-pine's Introduction

Cider 2 ThemeKit ๐ŸŽจ

This is my own fork of this to get a git-tracked theme working. it's I'm stupid, but you'll have to live with it.

๐ŸŒ Pre-requisites

โšก Quick Start

  • Clone this repo
  • Run npm install
  • Create a project with npm run create-new ./projects/my-theme
  • Run npm run serve ./projects/my-theme
  • Open Cider 2 and go to Settings > Experimental > Theme Manager
  • In the Main Menu, click Theme Manager and then click the SDK tab
  • The SDK tab should say "SDK is connected!"
  • Under the Themes tab you should see your theme listed, from here it can temporarily be enabled or disabled as well as installed permanently.

Be sure to read the Quirks and Features section before getting started.

๐Ÿ“ฎ Sharing your theme (temp)

  • Run npm run build ./projects/my-theme
  • The theme will be built into ./projects/my-theme/dist/theme.cider-theme
  • This file can installed by others by clicking Install from File in the Theme Manager

๐Ÿ–ฅ๏ธ Available Commands

Command Description Example
npm run create-new {path-to-project} Create a new theme project npm run create-new ./projects/my-theme
npm run serve {path-to-project} Host an SDK instance for the Cider Theme Manager to connect to npm run serve ./projects/my-theme
npm run build {path-to-project} Builds a sharable theme.cider-theme file in {path-to-project}/dist npm run build ./projects/my-theme

๐Ÿ“„ theme.json Explained

  • Author
    • Your name
  • Identifier
    • A unique identifier for your theme
  • Name
    • The name of your theme
  • Styles*
    • An array of stylesheets to be loaded into the theme
    • Currently they will all load at the same time, being able to toggle them individually like Cider 1.x is planned in the future

โš ๏ธ Quirks and Features (Important)

  • In Cider itself, you may notice some HTML elements have an attribute called [sfc-name="NameOfSFC"] this is added to easily target specific Vue Single File Components. When building your theme, we highly recommend you use these attributes to target specific elements. This is because the HTML structure of Cider is subject to change and we want to make sure your theme doesn't break when we make changes as well as when Vite decides to generate different data- tags.
    • Targeting [sfc-name] also has the benefit of not accidentally targeting multiple elements with the same class name that have different purposes and appearances.

Example of targeting an SFC

[sfc-name='NavigationButton'] {
    // Here we are modifying the .nav-icon class inside of the NavigationButton SFC, doing it this way ensures that other elements with the .nav-icon class are not affected by mistake.
    .nav-icon {
        color: red;
    }
}
  • Every CSS declaration is rewritten to use the !important flag. This is to ensure that the theme overrides the default styles.
  • Assets are inlined into the theme file and use paths are relative to the project folder itself. Example url('picture.png')
    • In compiled files these assets get automatically inlined
    • In dev mode the assets are served from the project folder

Targeting the Light or Dark color schemes example

body.body--light {
    // This will only apply to the light color scheme
}

body.body--dark {
    // This will only apply to the dark color scheme
}

Other attributes

#app-viewport[top-player='true | false'] // is the player on the top?
#app-viewport[left-drawer='true | false'] // left sidebar opened
#app-viewport[right-drawer='true | false'] // right sidebar opened
#app-viewport[right-drawer-type='inline | overlay'] // right sidebar type
#app-viewport[data-framework='electron | sabiiro'] // Client Type

body[window-blurred='true | false'] // is the window blurred or focused?
html[dark-acrylic] // is the acrylic effect enabled?

๐Ÿ“š Resources

ThemeKit Wiki โš ๏ธ Work in progress

If there are any other CSS selectors, variables, or attributes to expose you would like to suggest for ThemeKit, please let us know by creating an issue on this repository.

cider2-rose-pine's People

Contributors

booploops avatar

Watchers

rx avatar

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.