# Vipassana Meditation as Taught By S.N. Goenka - Design Standards

This repository contains the code for https://design-standards.dhamma.org/

It also provide files and packages to easily implement the design standards in your website

- [Ruby Gem Package](https://rubygems.org/gems/vipassana-design-standards)
- [NPM Package](https://www.npmjs.com/package/vipassana-design-standards)

In the following, VDS stands for Vipassana Design Standards

## Include the logo inside a website

The recommended way for using the logo is the SVG format :

```html
<a class="vds-logo-link" href="/">
  <div class="d-none d-md-inline-flex">
    <img
      src="https://design-standards.dhamma.org/dist/logo.svg"
      height="80"
      alt="Vipassana Meditation as Taught by S.N. Goenka"
    />
  </div>
  <div class="d-md-none d-flex">
    <img
      src="https://design-standards.dhamma.org/dist/logo-mobile.svg"
      height="40"
      alt="Vipassana Meditation as Taught by S.N. Goenka"
    />
  </div>
</a>
```

## Using our bootstrap5 theme

The best way to implement the whole design is to use our custom `bootstrap5-theme`

### For ruby apps - load with the gem (recommended)

See a [complete example here](https://github.com/dhammaorg/design-standards/blob/master/demo/app/views/layouts/application.html.erb)

```html
<head>
  <%= vds_bootstrap_theme_css_tag %> <%= vds_bootstrap_theme_js_tag %>
</head>
```

### Load with CDN

```html
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/vipassana-design-standards/dist/css/bootstrap5-theme.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/vipassana-design-standards/dist/js/bootstrap.bundle.min.js"></script>
```

### Install locally

first Install npm package

```
npm install vipassana-design-standards
yarn add vipassana-design-standards
```

Then include it

```
// application.scss
@use "vipassana-design-standards/src/stylesheets/bootstrap5-theme";

// To also use our design tokens ($blue-*, $spacer-x, ...):
// @use "vipassana-design-standards/src/stylesheets/index" as *;
```

```
// application.js
import 'bootstrap5';
```

### Layout structure

We have made a custom layout, with basic header and sidenav. In case you want to use it, you need to align with following page structure

```html
<html lang="xx" class="vds-html">
  <body class="vds-body">
    <div class="vds-header-and-content">
      <!-- Header -->
      <header class="vds-header">
        <div class="vds-container">
          <a href class="vds-logo-link"><!-- SVG logo see above --></a>
        </div>
      </header>

      <!-- Page -->
      <div class="vds-page vds-container">
        <div class="vds-sidenav">
          <ul>
            <li>
              <a href="#" class="active">Test</a>
            </li>
            <li>
              <a href="#">Other</a>
            </li>
          </ul>
        </div>
        <div class="vds-page-content">
          <!-- Page content -->
        </div>
      </div>
    </div>

    <!-- Footer -->
    <footer class="vds-footer">
      <div class="vds-container"></div>
    </footer>
  </body>
</html>
```

### Custom bootstrap utilities

Some class helpers have been added to complement the [bootstrap utilities](https://getbootstrap.com/docs/5.3/utilities/background/)

#### Font-family

```html
<div class="ff-normal">Normal font (Noto Sans)</div>
<div class="ff-headings">Headings font (Amiri)</div>
```

#### Font-size

```
.fs-normal

.fs-05-rem // font-size: .5rem
.fs-085-rem // font-size: .85rem
.fs-11-rem // font-size: 1.1rem
.fs-135-rem // font-size: 1.35rem

.fs-0X-em // font-size: .Xem
.fs-0X5-em // font-size: .X5em
.fs-1X-em // font-size: 1.Xem
.fs-1X5-em // font-size: 1.X5em

```

#### Other

```html
<div class="full-width-sm">
  this section will take full horizontal space in mobile screen, overriding
  default body padding
</div>

<button class="btn-floating-sm">
  Floating button on the bottom of the page, only for mobile
</button>

<div class="full-page-print">
  This section will take the whole screen when printing the page
</div>

<button class="btn btn-with-icon btn-primary">
  <i class="fa fa-leaf"></i>
  Click me
</button>
```

## Importing only fonts in your website

If you don't want the whole design, but just the fonts, you can do the following

```html
<!-- Prodive 2-letters language code in html lang attribute -->
<html lang="fr">
  <!-- Import fonts-->
  <link
    rel="stylesheet"
    href="https://cdn.jsdelivr.net/npm/vipassana-design-standards/dist/css/fonts.css"
  />

  <!-- Use the fonts where it's needed -->
  <style>
    body {
      font-family: var(--vds-font-family);
    }
    h1,
    h2 {
      font-family: var(--vds-headings-font-family);
    }
  </style>
</html>
```
