npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gitbook-plugin-theme-gestalt-yl

v1.0.27

Published

A configurable theme for GitBook

Downloads

675

Readme

gitbook主题插件,星图主题

截图

Gestalt Theme for Gitbook

Gestalt is a theme for Gitbook. While its layout is based off of the default Gitbook theme, it aims to be highly configurable for styling. This is achieved by porting the default theme styles to SASS and turning most things that were CSS rules into variables.

This theme is for you if the default theme is well enough, but you need more control in how it looks.

Screenshot

Usage

This theme works with Gitbook version >= 3.0.0. To include it in your project, edit your book.json to include the theme as a plugin.

"plugins": [ "theme-gestalt" ]

A recommended usage would be the following:

"plugins": [ "theme-gestalt", "-theme-default", "styles-sass-fix" ]

This configuration adds the Gestalt theme, removes the default theme, and includes the styles-sass-fix plugin to allow you to write your own SCSS to extend the styling. See Style Customization for more info.

Config Options

Below are the theme options available for Gestalt.

"pluginsConfig": {
	"theme-gestalt": {
	    "logo": "/assets/logo.png",			// path to the logo file to use in the sidebar
	    "favicon": "/assets/favicon.png",		// path to your favicon
	    "baseUrl": null,				// sets the base url in the HTML head
	    "excludeDefaultStyles": true,		// excludes the pre-compiled theme css in favor of your custom css
	    "doNotHideChildrenChapters" : false		// in summary, disables hiding of child chapters for inactive chapter
	}
}

Style Customization

Customizing the style of Gestalt is possible by creating a SCSS file in your project that includes Gestalt's SCSS but overwrites its variables. But first, we'll need to do some setup.

Setup

To customize the style of Gestalt, you must first do the following:

Exclude the Default Theme CSS

By default, Gitbook themes inject a CSS file into your project. However, we want to include your customized CSS file into the project instead. To achieve this, edit your book.json file to include the following:

"pluginsConfig": {
	"theme-gestalt": {
	    "excludeDefaultStyles": true
	}
}

Include the Styles-Sass plugin

In order to compile your custom SCSS, you'll need to include the styles-sass-fix plugin:

"plugins": [ "theme-gestalt", "-theme-default", "styles-sass-fix" ]

Customizing

Now that you're all setup, you'll need to include your custom SCSS file in your project. Edit your book.json to include your custom SCSS file:

"styles": {
    "website": "./styles/website.scss"
}

Now we get to the actual customization. In your custom SCSS file, overwrite the variables you need to achieve your look. Higher level variables can be found in _variables.scss, while more specific variables can found in the tops of the files in ./src/scss/website.

Here's an example custom SCSS file:

@import "../node_modules/gitbook-plugin-theme-gestalt/src/scss/variables";

// Put your variable overrides here
$book-background: black;
$page-background: black;
$sidebar-background: black;
$color-border: $color-gray-dark;

$color-primary: blue;
$color-text: red;

$heading-map : ( 
				color: $color-primary, 
				border-bottom: 1px solid $color-primary,
				font-family: $font-family-sans
				);

@import "../node_modules/gitbook-plugin-theme-gestalt/src/scss/all";

The above would then produce the following:

Screenshot