Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@scalar/themes

scalar386.9kMIT0.9.84TypeScript support: included

the default CSS variables for all Scalar packages

css, css-variables, scalar

readme

Scalar Themes

Version Downloads License Discord

Scalar Themes provides a library of themes for all Scalar products and components. It also contains the base set of Scalar CSS variables and an associated Tailwind preset which leverages those variables.

To see a list of available themes, see the presets export.

CSS Layers

The themes package uses two CSS Layers to apply the theme styles

  • scalar-base: A copy of the core Scalar CSS variables and default theme
  • scalar-theme: Optionally overrides scalar-base with theme styles

Any styles added outside of these layers will override all the styles in the layers which allows you to extend or customize a theme.

Scoping

Because many Scalar applications are embedded into other websites the reset is scoped to the scalar-app class. This means you need to add this class to the root element of your application where you want the theme to apply. If you are using the themes in a standalone application, you can just add this class to the body element.

<body class="scalar-app">
  <!-- Your application content -->
</body>

Installation

pnpm i @scalar/themes

Usage via CSS Import (Basic)

To import the basic theme styles into your project, you can just import style.css which imports the reset, scrollbars, and a copy of the base Scalar CSS variables and default theme.

import '@scalar/themes/styles.css'

To add a theme, you can import the theme from the presets directory.

import '@scalar/themes/presets/alternate.css'

Usage via JavaScript

To use the themes package via JavaScript, you can use the getThemeStyles function from the package. The function will generate CSS style string which you can then add to the head of your document.

import { getThemeStyles } from '@scalar/themes'

const styles = getThemeStyles('alternate', { layer: 'scalar-theme' })
document.head.insertAdjacentHTML('beforeend', `<style>${styles}</style>`)

The function allows you to pass in a theme ID and an optional options object to configure the layer (default: scalar-theme) and whether to include the default fonts (default: true).

Usage via Tailwind

To use the themes package with Tailwind, you first need to inject the import the styles either via CSS or JavaScript (see above). You can also import them alongside your global Tailwind styles.

@import '@scalar/themes/style.css';
@tailwind components;
@tailwind utilities;
@tailwind variants;

Then you can use the tailwind preset in your tailwind.config.js to expose the theme colors and variables.

import scalarPreset from '@scalar/themes/tailwind'
import { type Config } from 'tailwindcss'

export default {
  presets: [scalarPreset],
  // Your tailwind config
  theme: {
    extend: {
      // Extend the preset
    },
    // Override the preset
  },
} satisfies Config

changelog

@scalar/themes

0.9.84

Patch Changes

0.9.83

Patch Changes

0.9.82

Patch Changes

  • Updated dependencies [8efedf3]
  • Updated dependencies [82a4ba8]
  • Updated dependencies [57feba6]

0.9.81

Patch Changes

0.9.80

Patch Changes

0.9.79

Patch Changes

0.9.78

Patch Changes

  • 1437882: feat(components): create ScalarTextInput and ScalarTextArea
  • e00fa7e: feat(api-reference): add p3 color support to default scalar theme
  • 632978d: fix(themes): hide summary caret in reset

0.9.77

Patch Changes

0.9.76

Patch Changes

0.9.75

Patch Changes

0.9.74

Patch Changes

0.9.73

Patch Changes

0.9.72

Patch Changes

  • 89d8b75: feat: new ApiReferenceConfiguration type
  • Updated dependencies [89d8b75]
  • Updated dependencies [8a04b8d]

0.9.71

Patch Changes

  • 0d4520f: fix(themes): improve how we handle zoomed in screens

0.9.70

Patch Changes

0.9.69

Patch Changes

  • c9a8fd8: feat(components): add sidebar nesting indicator lines
  • 9251b22: feat(themes): add font-sans for default scalar font
  • 8d9a2c0: feat: updates danger variable + add background alert variable
  • Updated dependencies [946a5df]
  • Updated dependencies [cf14cbb]

0.9.68

Patch Changes

0.9.67

Patch Changes

  • fa6afe8: chore: code formatting
  • Updated dependencies [54fdfcb]
  • Updated dependencies [fa6afe8]

0.9.66

Patch Changes

  • Updated dependencies [f500435]
  • Updated dependencies [b5727ef]
  • Updated dependencies [34e6f52]
  • Updated dependencies [f2b082a]

0.9.65

Patch Changes

0.9.64

Patch Changes

0.9.63

Patch Changes

  • 51f3177: fix: removes inset from box shadow variable
  • Updated dependencies [be34e7d]

0.9.62

Patch Changes

  • 776a4e2: docs(themes): update themes readme
  • 2ed681b: feat: adds reset outline offset for button
  • 4f12fe4: feat(themes): add scalar danger color
  • Updated dependencies [702c386]
  • Updated dependencies [f1f39b0]

0.9.61

Patch Changes

0.9.60

Patch Changes

  • e866487: feat(components): create dark light toggle components
  • Updated dependencies [60cd6f1]
  • Updated dependencies [60cd6f1]

0.9.59

Patch Changes

0.9.58

Patch Changes

  • 6407b2b: feat(api-reference): extend font weights for links and sidebar items

0.9.57

Patch Changes

0.9.56

Patch Changes

  • 23daedd: feat(components): create ScalarHeader component

0.9.55

Patch Changes

0.9.54

Patch Changes

0.9.53

Patch Changes

0.9.52

Patch Changes

  • 1fa0d20: feat(themes): add commonjs export for themes

0.9.51

Patch Changes

  • 91123e8: chore: export each theme individually for easier access
  • Updated dependencies [9d23f95]

0.9.50

Patch Changes

  • 1b06f64: fix(api-reference): conflicting styles with bulma, galaxy bug on docs

0.9.49

Patch Changes

  • d379b81: feat(themes): expose tailwind preset as js not just ts
  • f67c3bc: feat: add framework themes
  • Updated dependencies [f67c3bc]

0.9.48

Patch Changes

  • 0c07766: fix: sets selection style properly"

0.9.47

Patch Changes

0.9.46

Patch Changes

0.9.45

Patch Changes

  • bb3dc9d: fix(api-reference): improve endpoint and tag accessibility
  • Updated dependencies [fb798c8]

0.9.44

Patch Changes

  • ad12c56: (style)api-client: fix client border bottom colors

0.9.43

Patch Changes

  • 197e3ae: (style)api-client: make input styles more consistent

0.9.42

Patch Changes

  • 2456afa: fix: remove theme selection as it was breaking on external sites

0.9.41

Patch Changes

0.9.40

Patch Changes

  • 6bbb815: fix(api-reference): search modal a11y improvements

0.9.39

Patch Changes

  • 4722da1: fix(themes): remove vendor prefixes for input placeholder

0.9.38

Patch Changes

  • 4b8b611: fix: removes focus visible style from reset
  • Updated dependencies [dbbe38f]

0.9.37

Patch Changes

0.9.36

Patch Changes

  • d02d70c: style: updates border color presets
  • Updated dependencies [e911047]

0.9.35

Patch Changes

  • b26144c: fix(themes): remove variables from theme layer and move selection to default (base) theme

0.9.34

Patch Changes

0.9.33

Patch Changes

  • 1026d81: feat: adds themes high contrast selection
  • 07b5439: feat: enhances command palette navigation and style
  • Updated dependencies [8f12149]

0.9.32

Patch Changes

  • f961940: chore: add @scalar/types to dependency for ThemeId type
  • Updated dependencies [f961940]

0.9.31

Patch Changes

  • 7beeef3: fix: modal dark mode bg

0.9.30

Patch Changes

  • 121bc7e: chore: update lint, prettier and format theme

0.9.29

Patch Changes

  • c577cde: feat(themes): make base dark mode colors opaque

0.9.28

Patch Changes

  • 80a3c46: fix(theme): add SSR check to obtrusive scroll check

0.9.27

Patch Changes

  • bb13304: fix(themes): remove obtrusive scrollbar test after testing

0.9.26

Patch Changes

  • abb8ddd: fix(themes): always show obtrusive scrollbars

0.9.25

Patch Changes

  • 78db8f5: feat: use new @scalar/types package

0.9.24

Patch Changes

  • 298f7c4: fix(themes): restrict flare overflow for themes

0.9.23

Patch Changes

  • c450bb3: fix: scalar api ref use scalar-border-width

0.9.22

Patch Changes

  • 60e63d3: fix(themes): sets a default for scalar brightness filters

0.9.21

Patch Changes

  • faf3ed9: fix: style updates to client app

0.9.20

Patch Changes

  • 425dc83: fix(api-client): rebuild address bar history with grid

0.9.19

Patch Changes

  • 3a6effa: feat(api-client): add response previews

0.9.18

Patch Changes

  • c1ada84: feat(api-client): add the ability to delete and rename folders and collections

0.9.17

Patch Changes

  • de25d01: feat(api-client): add the ability to delete and rename folders and collections

0.9.16

Patch Changes

  • a5f3a84: feat(components): create combo box component

0.9.15

Patch Changes

  • 5e060b1: fix: don’t minify the CSS

0.9.14

Patch Changes

  • 96e7106: fix: switch from font-size unset to inherit

0.9.13

Patch Changes

  • 618285e: feat: add localStorage syncing to client app

0.9.12

Patch Changes

  • f1b5390: fix: remove tailwind preflight from api client app

0.9.11

Patch Changes

  • 4250fe2: fix: build tailwind preset with vite before exporting

0.9.10

Patch Changes

  • cdfb8c5: feat: focus visible outline style

0.9.9

Patch Changes

  • 3b83b82: fix: empty html response show theme background

0.9.8

Patch Changes

  • 94e68ab: chore: upgrade typescript to 5.5

0.9.7

Patch Changes

  • 3b53db5: style(client-app): new authentication UI

0.9.6

Patch Changes

  • e88a2c2: refactor(themes): internalize tailwind pixel preset

0.9.5

Patch Changes

  • 5e92eab: feat(#doc-1996): themes css exports

0.9.4

Patch Changes

  • 2ca1af2: fix: kepler theme darkmode

0.9.3

Patch Changes

  • 0fae180: chore: move client app to use @scalar/themes tailwind preset

0.9.2

Patch Changes

  • a2cb3c3: Migrate away from unintended peer dependencies

0.9.1

Patch Changes

  • e0fc110: chore: patch bump all package

0.9.0

Minor Changes

  • 7f8ef74: chore: remove aliasing

Patch Changes

  • 8494349: Migrate to highlightjs based syntax highlighting
  • b38c7ed: Update build configs to a standardized format
  • 6fbb57e: feat: release all the packages

0.8.2

Patch Changes

  • 55e01dd: fix: copy fonts to dist directory

0.8.1

Patch Changes

  • db7864a: feat: self host fonts on scalar cdn

0.8.0

Minor Changes

  • 7d3bc16: feat: css files must be explicitly imported, check the docs
  • 7d3bc16: BREAKING CHANGE: css must now be explicitly imported, see docs for more details

Patch Changes

  • a839889: fix: also use cascade layers for CSS reset to avoid overriding tailwind

0.7.11

Patch Changes

  • 69a617c: fix: remove yellow/blue autofill indicator

0.7.10

Patch Changes

  • 1ce9661: feat: intro cards redesign

0.7.9

Patch Changes

  • 45dc04b: fix: can’t release packages

0.7.8

Patch Changes

  • 05e2e27: chore: add provenance statement

0.7.7

Patch Changes

  • d4fa19b: feat: allow multiple configs for nuxt

0.7.6

Patch Changes

  • 0a77380: fix: don't minify theme css

0.7.5

Patch Changes

  • 2700c5c: feat: separate google fonts from theme, add withDefaultFonts setting

0.7.4

Patch Changes

  • 86d1363: refactor: remove @layer from base theme files

0.7.3

Patch Changes

  • 4d31b19: refactor: move theme labels to @scalar/themes

0.7.2

Patch Changes

  • 85a0074: fix: hotfix integration fonts

0.7.1

Patch Changes

  • d77acdd: fix: missing css font

0.7.0

Minor Changes

  • 0e64a36: refactor: rename all --theme-_ variables to --scalar-_

Patch Changes

  • 22f2858: chore: ran syncpack to update packages

0.6.7

Patch Changes

  • d70bda7: fix: text decoration targetting in themes + unused css in themes

0.6.6

Patch Changes

  • 5b83e30: fix: put border indents in proper file
  • ae193a8: feat: sidebar border indents + theme polish

0.6.5

Patch Changes

  • 0c5e22c: fix: section flare if position fixed

0.6.4

Patch Changes

  • 68cda2b: feat: add x-tagGroups in sidebar

0.6.3

Patch Changes

  • 897990b: fix: mobile backgrounds for mars and blueplanet

0.6.2

Patch Changes

  • ddc9b17: fix: re-added moving the components css into js so importing the css file is no longer needed
  • 775646a: fix: removed extra copy of vue from themes and some dependencies
  • ef3a015: chore: update to typescript 5.4

0.6.1

Patch Changes

  • 4ef178f: fix: define color-scheme to improve request client selector readability

0.6.0

Minor Changes

  • ad2b95a: fix: scope scrollbar styles
  • ad2b95a: refactor: move reset component to themes package

0.5.10

Patch Changes

  • 51acf2c: fix: sidebar theme precedence and remove unused OSS variables

0.5.9

Patch Changes

  • c103201: fix: polish sidebar
  • d2728c8: fix: theme fixes

0.5.8

Patch Changes

  • 1669b27: chore: update dependencies

0.5.7

Patch Changes

  • c6b95ca: chore: upgrade from Vite 4 to Vite 5

0.5.6

Patch Changes

  • 5b3f7d9: fix: updated scroll region padding to for chrome update

0.5.5

Patch Changes

  • 92a8b9f: chore: update dependencies

0.5.4

Patch Changes

  • 81543f42: chore: add support for Node 18

0.5.3

Patch Changes

  • 5ca138ee: - Removed activeBreadCrumb from api-client as its available in the slot
    • Centralized navigation logic
    • use proper anchor navigation instead of scrollIntoView, it will also be saved to history
    • scrolling down will open the next section

0.5.2

Patch Changes

  • 6d777194: feat: release themes

0.5.1

Patch Changes

  • a1319e8b: Switched internal component library to use ScalarComponents instead

0.5.0

Minor Changes

  • f38bb61: chore: remove swagger editor tabs

0.4.2

Patch Changes

  • c3b215f: chore: no pinned peer dependency versions

0.4.1

Patch Changes

  • 55246e5: chore: rewrite all package.jsons (including their prod, dev and peer dependency requirements)

0.4.0

Minor Changes

  • fd38deb0: Add mobile menu and breadcrumbs

0.3.11

Patch Changes

  • af4ec8d3: update discord links

0.3.10

Patch Changes

  • 1cbcabd7: lots of amazing fixes from when we missed last patch

0.3.9

Patch Changes

  • eb0c3201: Lot's of small things + bigger temp fix for the multi content cards

0.3.8

Patch Changes

  • 46142c0a: reference theme fixes

0.3.7

Patch Changes

  • 1d02c811: fix: use ?inline imports for CSS files

0.3.6

Patch Changes

  • b76f4d1e: Reference search + some app hover states

0.3.5

Patch Changes

  • 4985562c: polish codemirror theme colors

0.3.4

Patch Changes

  • cd5f2685: codemirror colors + font fixes throughout app

0.3.3

Patch Changes

  • 048555c6: feat: add CHANGELOG.md to the package

0.3.2

Patch Changes

  • 75a69ba7: feat: add theme prop and improve theme support
  • 75a69ba7: refactor: rename @scalar/default-theme to @scalar/themes, add more themes

0.3.1

Patch Changes

  • b184bdf2: codemirror themeing and other theme fixes
  • addd9fa2: feat: use default prefix for all CSS variables

0.3.0

Minor Changes

  • 87fda5af: chore: update dependencies

Patch Changes

  • ef080a26: chore: format package.json

0.2.1

Patch Changes

  • 10498d9d: chore: add README
  • 494083a0: add more information to the package.json

0.2.0

Minor Changes

  • 5057e213: make npm packages public :-)

0.1.1

Patch Changes

  • de4ff38: feat: add a new @scalar/themes package to import the variables and custom scrollbar CSS