Skip to content

Conversation

zenoachtig
Copy link
Contributor

@zenoachtig zenoachtig commented Dec 6, 2024

This PR adds support for the new tint colour customisation setting. It is meant as an additional way to theme your docs by subtly colouring various elements of your theme, such as the background or header. The primary-color remains in use for primary navigation elements such as links and buttons.

This first PR aims to swap the properties used in colour calculations without introducing big visual changes. In future PRs will propose new ways of using tint in various places. There are no changes for sites that have not opted into the Tint setting.

  • Create tint-color and contrast-tint CSS variables
  • Use tint-color to set base colour palette (light-* and dark-* variables)
  • Use tint-color for the header colour of Bold. When Custom is used, the set "Header background" and "Link color” settings take precedence over tint colour.
  • Deprecate plain-background Tailwind variant in favour of tint and no-tint variants.
  • Deprecate primary-base variable in favour of tint-color

Preview

  • Without tint: same as current Background: plain
  • Primary tint: same as current Background: match
  • Custom tint: new functionality

Default

No changes with tint off. If tint is enabled, we colour the bg slightly with the tint color (primary color or custom color)

Default, without tint Default, primary tint

Bold

No changes with tint off. If tint is enabled, we colour the bg slightly and header strongly with the tint color. The links are always set to a contrast of the tint color.

Bold, without tint Bold, primary tint Bold, custom tint

Contrast

No changes with tint off. If tint is enabled, we colour only the bg slightly. Header stays contrasting.

Contrast, without tint Contrast, primary tint “Contrast,

Custom

No changes with tint off – we use the custom-set headerBackgroundColor and headerLinkColor. If tint is enabled, we colour only the bg slightly. The custom header colours stay in place. We aim to eventually clean up these options, favouring tint over custom-set header colours.

Custom, without tint Custom, primary tint Custom, custom tint

Resolves RND-5670

Copy link

changeset-bot bot commented Dec 6, 2024

🦋 Changeset detected

Latest commit: 44b2642

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 9, 2024

GitBook Preview
Latest commit: https://5532822e.gitbook-open.pages.dev
PR: https://pr2605.gitbook-open.pages.dev

Copy link

argos-ci bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 47 changed, 48 removed, 12 failures Dec 31, 2024, 11:12 PM

To make some gray elements (like codeblocks) a bit less harsh.
@zenoachtig zenoachtig merged commit 664debc into main Dec 9, 2024
9 checks passed
@zenoachtig zenoachtig deleted the add-tint-color branch December 9, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants