### Install Open Props Beta using pnpm or npm Source: https://open-props-ui.netlify.app/guide/getting-started Instructions for installing the Open Props beta version (v2.0.0-beta.5) using either pnpm or npm package managers. This is a prerequisite for using Open Props UI. ```shell # pnpm pnpm add opbeta@npm:open-props@2.0.0-beta.5 -S # npm npm i opbeta@npm:open-props@2.0.0-beta.5 -S ``` -------------------------------- ### NPM Installation for opui-css Source: https://open-props-ui.netlify.app/guide/getting-started This command shows how to install the opui-css package using pnpm or npm. It's a prerequisite for using the Open Props UI library in your project. ```sh # pnpm pnpm add opui-css -S # npm npm i opui-css -S ``` -------------------------------- ### Importing Themes and Components (CSS) Source: https://open-props-ui.netlify.app/guide/getting-started This CSS snippet demonstrates how to import themes and specific components from the opui-css package. It shows how to import the default theme, a specific theme ('theme-one'), components only, and the Open Props setup. ```css /* Import theme-two (default) */ @import "opui-css"; /* Import theme-one */ @import "opui-css/theme-one"; /* Import just the components for theme-one */ @import "opui-css/theme-one/components"; /* Import only the Open Props setup */ @import "opui-css/open-props"; ``` -------------------------------- ### Set Up OPUI Theme with Color Schemes and Typography Source: https://open-props-ui.netlify.app/guide/getting-started This CSS code snippet defines the core theme setup for OPUI, including light and dark color schemes, primary color variations, text and surface colors, shadows, and typography settings. It uses CSS custom properties and `light-dark()` for adaptive theming. ```css /* theme one theme setup */ @layer theme { .light { --color-scheme: light; } .dark { --color-scheme: dark; } :where(html) { color-scheme: var(--color-scheme, light dark); --palette-hue: var(--oklch-teal); --palette-hue-rotate-by: 5; --palette-chroma: 0.89; /* Primary */ --primary: var(--color-8); --primary-light: oklch(from var(--primary) calc(l * 1.25) c h); --primary-dark: oklch(from var(--primary) calc(l * 0.75) c h); --primary-contrast: var(--gray-1); /* Text */ --text-color-1: light-dark(var(--gray-15), var(--gray-1)); --text-color-1-contrast: light-dark(var(--gray-2), var(--gray-15)); --text-color-2: light-dark(var(--gray-13), var(--gray-4)); --text-color-2-contrast: light-dark(var(--gray-4), var(--gray-13)); /* Surface */ --surface-default: light-dark(var(--gray-1), var(--gray-13)); --surface-filled: light-dark(var(--gray-3), var(--gray-15)); --surface-tonal: light-dark(var(--gray-3), var(--gray-12)); --surface-elevated: light-dark(var(--gray-1), var(--gray-12)); /* Shadows */ --shadow-color: light-dark(220 3% 15%, 220 40% 2%); --shadow-strength: light-dark(1%, 10%); --inner-shadow-highlight: light-dark( inset 0 -0.5px 0 0 #fff, inset 0 0.5px 0 0 #0001, inset 0 -0.5px 0 0 #fff1, inset 0 0.5px 0 0 #0007 ); /* Typography */ --font-size-h1: var(--font-size-fluid-3, 3.5rem); --font-size-h2: var(--font-size-fluid-2, 2rem); --font-size-h3: var(--font-size-fluid-1, 1.5rem); --font-size-h4: var(--font-size-3, 1.25rem); --font-size-h5: var(--font-size-2, 1.1rem); --font-size-h6: var(--font-size-fluid-0, 1rem); --font-size-lg: var(--font-size-3, 1.25rem); --font-size-md: var(--font-size-fluid-0, 1rem); --font-size-sm: 0.875rem; --font-size-xs: var(--font-size-0, 0.75rem); /* Borders */ --border-color: light-dark(var(--gray-4), var(--gray-12)); --border-radius: var(--size-1); --border-width: 1px; /* Input Field */ --field-border-color: var(--border-color); --field-border-radius: var(--size-1); --field-border-width: 1px; --field-size: 2.3lh; --field-size-small: 1.9lh; /* Button */ --button-border-radius: var(--radius-round); /* Ripple effect */ @media (prefers-reduced-motion: no-preference) { --button-ripple-size: 100%; --button-ripple-duration: 0.5s; } } /* Highlight colors */ :where(.red, .error, del) { --palette-hue: var(--oklch-red, 25); --palette-chroma: 1; --palette-hue-rotate-by: 1; } :where(.blue, .ok, abbr, dfn) { --palette-hue: var(--oklch-blue, 210); --palette-chroma: 1; --palette-hue-rotate-by: 1; } :where(.green, .good, ins) { --palette-hue: var(--oklch-green, 145); --palette-chroma: 1; --palette-hue-rotate-by: 1; } :where(.orange, .warning) { --palette-hue: var(--oklch-orange, 75); --palette-chroma: 1; --palette-hue-rotate-by: 1; } :where(html) { --red: oklch(from var(--color-9) l 0.2 25); --blue: oklch(from var(--color-9) l 0.2 210); --green: oklch(from var(--color-9) l 0.2 145); --orange: oklch(from var(--color-7) l 0.2 75); } /* Gray palette */ :where(html) { --gray-chroma: 0.01; --gray-lightness: 255; --gray-1: oklch( from var(--color-1) l var(--gray-chroma) var(--gray-lightness) ); --gray-2: oklch( from var(--color-2) l var(--gray-chroma) var(--gray-lightness) ); --gray-3: oklch( from var(--color-3) l var(--gray-chroma) var(--gray-lightness) ); ``` -------------------------------- ### Configure Open Props Imports for Theming and Utilities Source: https://open-props-ui.netlify.app/guide/getting-started This CSS code snippet shows how to import Open Props, including specific modules like media queries and sizes, along with the main index file and font line-height settings. It leverages layers for organization and specifies the path to the Open Props CSS files. ```css /* * Open Props * Import as many props as you need here. * https://unpkg.com/browse/open-props@2.0.0-beta.5/css */ @import "open-props/css/media-queries.css"; @import "open-props/index.css" layer(openprops); @import "open-props/css/sizes/media.css" layer(openprops); @import "open-props/css/font/lineheight.css" layer(openprops); @import "open-props/hues.oklch.css" layer(openprops); ``` -------------------------------- ### HTML Blockquote Element Example Source: https://open-props-ui.netlify.app/components/typography Shows the correct usage of the HTML blockquote element for representing quoted text, including an optional footer for attribution. The example includes a quote and its source. ```html
"Occupy your mind, don't stay home. Talk to all your friends, but don't look at your phone”
``` -------------------------------- ### HTML Inline Text Elements Examples Source: https://open-props-ui.netlify.app/components/typography Provides examples of various HTML inline text elements for semantic and stylistic purposes, including abbreviations, definitions, bold, italic, deleted, inserted, keyboard input, highlighted text, strikethrough, small text, subscript, superscript, and underline. ```html Abbr.| `` Definition| `` **Bold**| `` , `` _Italic_| `` , ``, `` ~~Deleted~~| `` Inserted| `` `Ctrl + S`| `` Highlighted| `` ~~Strikethrough~~| `` Small| `` Text Sub| `` Text Sup| `` _Underline_| `` ``` -------------------------------- ### List Item with Start Video (HTML) Source: https://open-props-ui.netlify.app/components/list Illustrates embedding a video in the start section of a list item. The `div.start` contains a `