Giter VIP home page Giter VIP logo

bookit's People

Contributors

ananni13 avatar andrecasal avatar chessydk avatar edmundhung avatar imcodingideas avatar jacobparis avatar jansedlon avatar justinhenricks avatar kentcdodds avatar kettanaito avatar lgastler avatar littletonconnor avatar mansuralikoroglu avatar markgaze avatar mat-moran avatar mattfysh avatar michaeldeboey avatar michventura avatar mxschmitt avatar nathanvale avatar onemen avatar paolapog avatar pawelblaszczyk5 avatar rajeshg avatar scefali avatar scr2em avatar squidpunch avatar takagimeow avatar xhomu avatar xiphe avatar

Watchers

 avatar

bookit's Issues

Setup up dark themes correctlly to reduce the luminance emitted by device screens, while still meeting minimum color contrast ratio

Problem

Current dark theme doesn't meet Web Content Accessibility Guidelines

Contrast: Dark surfaces and 100% white body text have a contrast level of at least 15.8:1
Depth: At higher levels of elevation, components express depth by displaying lighter surface colors
Desaturation: Primary colors are desaturated so they pass the Web Content Accessibility Guidelines’ (WCAG) AA standard of at least 4.5:1 (when used with body text) at all elevation levels
Limited color: Large surfaces use a dark surface color, with limited color accents (light, desaturated and bright, saturated colors)

Elevation

Elevation is the relative distance between two surfaces along the z-axis.

In a dark theme, components retain the same default elevation levels and shadows as components in lighter themes. However, in a dark theme, the surfaces of different elevation levels are illuminated differently.

image

Solution

Z depth to be achieved using css shadows

/* Surface at elevation 0 (no elevation) */
.my-surface-0 {
  box-shadow: none;
}

/* Surfaces at elevations 1 to 24 */
.my-surface-1 {
  box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2),
              0 1px 1px 0 rgba(0, 0, 0, 0.14),
              0 1px 3px 0 rgba(0, 0, 0, 0.12);
}

.my-surface-2 {
  box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
              0 2px 2px 0 rgba(0, 0, 0, 0.14),
              0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.my-surface-3 {
  box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14),
              0 3px 3px -2px rgba(0, 0, 0, 0.12),
              0 1px 8px 0 rgba(0, 0, 0, 0.2);
}

.my-surface-4 {
  box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14),
              0 1px 10px 0 rgba(0, 0, 0, 0.12),
              0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.my-surface-5 {
  box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.14),
              0 2px 4px -1px rgba(0, 0, 0, 0.12),
              0 4px 5px 0 rgba(0, 0, 0, 0.2);
}

.my-surface-6 {
  box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14),
              0 1px 18px 0 rgba(0, 0, 0, 0.12),
              0 3px 5px -1px rgba(0, 0, 0, 0.2);
}

.my-surface-7 {
  box-shadow: 0 7px 10px 1px rgba(0, 0, 0, 0.14),
              0 2px 16px 1px rgba(0, 0, 0, 0.12),
              0 4px 6px 2px rgba(0, 0, 0, 0.2);
}

.my-surface-8 {
  box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),
              0 3px 14px 2px rgba(0, 0, 0, 0.12),
              0 5px 5px -3px rgba(0, 0, 0, 0.2);
}

.my-surface-9 {
  box-shadow: 0 9px 12px 1px rgba(0, 0, 0, 0.14),
              0 3px 16px 2px rgba(0, 0, 0, 0.12),
              0 5px 6px -3px rgba(0, 0, 0, 0.2);
}

.my-surface-10 {
  box-shadow: 0 10px 13px 1px rgba(0, 0, 0, 0.14),
              0 4px 18px 3px rgba(0, 0, 0, 0.12),
              0 6px 7px -4px rgba(0, 0, 0, 0.2);
}

.my-surface-11 {
  box-shadow: 0 11px 15px 1px rgba(0, 0, 0, 0.14),
              0 4px 20px 3px rgba(0, 0, 0, 0.12),
              0 6px 8px -4px rgba(0, 0, 0, 0.2);
}

.my-surface-12 {
  box-shadow: 0 12px 17px 2px rgba(0, 0, 0, 0.14),
              0 5px 22px 4px rgba(0, 0, 0, 0.12),
              0 7px 9px -5px rgba(0, 0, 0, 0.2);
}

.my-surface-13 {
  box-shadow: 0 13px 19px 2px rgba(0, 0, 0, 0.14),
              0 5px 24px 4px rgba(0, 0, 0, 0.12),
              0 7px 10px -5px rgba(0, 0, 0, 0.2);
}

.my-surface-14 {
  box-shadow: 0 14px 21px 2px rgba(0, 0, 0, 0.14),
              0 5px 26px 4px rgba(0, 0, 0, 0.12),
              0 8px 10px -5px rgba(0, 0, 0, 0.2);
}

.my-surface-15 {
  box-shadow: 0 15px 22px 2px rgba(0, 0, 0, 0.14),
              0 6px 28px 5px rgba(0, 0, 0, 0.12),
              0 8px 11px -5px rgba(0, 0, 0, 0.2);
}

.my-surface-16 {
  box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14),
              0 6px 30px 5px rgba(0, 0, 0, 0.12),
              0 8px 12px -6px rgba(0, 0, 0, 0.2);
}

.my-surface-17 {
  box-shadow: 0 17px 26px 2px rgba(0, 0, 0, 0.14),
              0 6px 32px 5px rgba(0, 0, 0, 0.12),
              0 8px 13px -6px rgba(0, 0, 0, 0.2);
}

.my-surface-18 {
  box-shadow: 0 18px 28px 2px rgba(0, 0, 0, 0.14),
              0 7px 34px 6px rgba(0, 0, 0, 0.12),
              0 9px 14px -6px rgba(0, 0, 0, 0.2);
}

.my-surface-19 {
  box-shadow: 0 19px 29px 2px rgba(0, 0, 0, 0.14),
              0 7px 36px 6px rgba(0, 0, 0, 0.12),
              0 9px 15px -6px rgba(0, 0, 0, 0.2);
}

.my-surface-20 {
  box-shadow: 0 20px 31px 3px rgba(0, 0, 0, 0.14),
              0 8px 38px 7px rgba(0, 0, 0, 0.12),
              0 10px 16px -7px rgba(0, 0, 0, 0.2);
}

.my-surface-21 {
  box-shadow: 0 21px 33px 3px rgba(0, 0, 0, 0.14),
              0 8px 40px 7px rgba(0, 0, 0, 0.12),
              0 10px 17px -7px rgba(0, 0, 0, 0.2);
}

.my-surface-22 {
  box-shadow: 0 22px 35px 3px rgba(0, 0, 0, 0.14),
              0 8px 42px 7px rgba(0, 0, 0, 0.12),
              0 10px 18px -7px rgba(0, 0, 0, 0.2);
}

.my-surface-23 {
  box-shadow: 0 23px 36px 3px rgba(0, 0, 0, 0.14),
              0 9px 44px 8px rgba(0, 0, 0, 0.12),
              0 11px 19px -7px rgba(0, 0, 0, 0.2);
}

.my-surface-24 {
  box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.3),
              0 9px 46px 8px rgba(0, 0, 0, 0.22),
              0 11px 15px -7px rgba(0, 0, 0, 0.2);
}

To create the surface level colors use this library

https://gka.github.io/chroma.js/#chroma-mix

chroma.mix('#121212', 'white', 0.03, 'rgb');
chroma.mix('#121212', 'white', 0.03, 'hsl');
chroma.mix('#121212', 'white', 0.03, 'lab');

Where #121212 is the background color and different levels of white opacity are applied.

Perhaps dynamically create this in the tailwind config based off the var(--background)?

Final theme should be based on Material Design baseline themes

image

Update font to match shadui

import { JetBrains_Mono as FontMono, Inter as FontSans } from "next/font/google"

export const fontSans = FontSans({
  subsets: ["latin"],
  variable: "--font-sans",
})

export const fontMono = FontMono({
  subsets: ["latin"],
  variable: "--font-mono",
})

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.