Preferably screenshot

Preferably

Author Avatar Theme by Amirmasoudabdol
Updated: 26 Jul 2024
61 Stars

An accessible template for `pkgdown` websites with dynamic light/dark mode support

Categories

Overview

Preferably is an accessible template for pkgdown documentation websites. It offers light and dark themes and utilizes the prefers-color-scheme CSS variable to automatically serve the appropriate theme based on users’ operating system settings. Users can also manually toggle between the light and dark themes. In addition to the themes, Preferably enhances the overall reading experience by using richer fonts and a better color scheme for codes.

Features

  • Accessible Themes: Preferably provides light and dark themes for pkgdown documentation websites.
  • Automatic Theme Switching: The template uses the prefers-color-scheme CSS variable to automatically serve the appropriate theme based on users’ operating system settings.
  • Manual Theme Toggle: Users can manually toggle between the light and dark themes with a switch in the menu bar.
  • Enhanced Reading Experience: Preferably improves the overall reading experience of pkgdown documentations with richer fonts and a better color scheme for codes.
  • Compatibility with pkgdown 2.0 and Bootstrap 5: Preferably 0.4 is compatible with pkgdown 2.0 and Bootstrap 5.
  • Custom Analytics: Users can add a custom analytic (in addition to ganalytics) to their website using the canalytic option.
  • Flexible Customization: Preferably offers additional options for customization, in addition to the pkgdown customization options.

Installation

To install Preferably, you can download the stable version from CRAN using the following command:

install.packages("preferably")

Alternatively, you can download the development version from GitHub.

Summary

Preferably is an accessible template for pkgdown documentation websites that offers light and dark themes with automatic theme switching based on users’ operating system settings. It provides an enhanced reading experience with richer fonts and a better color scheme for codes. The template is compatible with pkgdown 2.0 and Bootstrap 5 and offers flexibility for customization. Additionally, Preferably allows users to add custom analytics and provides a manual toggle for theme selection.