Coder Social home page Coder Social logo

argyleink / open-props Goto Github PK

View Code? Open in Web Editor NEW
4.4K 33.0 186.0 53.78 MB

CSS custom properties to help accelerate adaptive and consistent design.

Home Page: https://open-props.style

License: MIT License

JavaScript 24.83% CSS 30.84% HTML 44.33%
css css-utilites css-custom-properties css-custom-media-queries css-colors css-gradients css-easing-functions css-normalise

open-props's Introduction

Open Props Logo

Open Source CSS Variables

colors gradients shadows aspect ratios typography
easings animations sizes borders z-indexes media-queries

Tests npm version Discord


Need help? ย  ๐Ÿ‘‰ ย  Discord


CDN (browse)

Bookmarklet

javascript: (() => {
  const href = "https://unpkg.com/open-props";
  document.head.append(Object.assign(document.createElement("link"),{rel:"stylesheet",href}));
})();

CLI

  • npm run gen:op - runs through src/ js files and creates the PostCSS files in src/
  • npm run gen:nowhere - creates a version of Open Props without the use of :where()
  • npm run gen:shadowdom - creates a version of Open Props with :host as the selector scope
  • npm run gen:prefixed - creates a version of Open Props with each prop prefixed with op, like --op-font-size-1
  • npm run bundle - creates all the various minified bundles of props
  • npm run lib:js - builds the JS modules for NPM

open-props's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open-props's Issues

`normalize.css` demo page

something between the html5 test page and an actually semi-designed page

  • should showcase web elements
  • should showcase light/dark theme
  • should explain reasons for many of the opinionated reset choices

visual regression testing

even if for now it screenshots the test index page and compares a PR against it. it'd be testing the reset mostly, so it'd be more like an e2e test, but that's coo until something stronger get's built.

Headline ideas

what's the one thing that's most valuable about open props?

Scrollspy

Navbar links should highlight when you're within each section

Theming

light and dark custom theme examples for designcember

Remove SVG

put grain work into gradients and see if there's actual path data worth stashing in this svg file for use in d

Guides section

How to's with open-props:

  • light, dark, dim themes
  • dense, loose spacing themes
  • use with sprinkles
  • use with tailwind
  • use with something else?

what other guides should we be looking to have ready?

Bundles need selector grouping/merging

the props.css bundle ships the selector html {} or :where(html) {} for each imported prop pack. optimally, these would be merged for production and share selectors.

maybe it's an optional build time flag to flip on? it sounds aggressive, so maybe that's why it's off by default?

reset stylesheet should ship normal looking links

the hotpink links are a bit much, instead:

  • use pinks as visited links
  • use the standard dark and light theme blue from browsers (light: hsl(240 100% 47%), dark: hsl(240 100% 81%))
  • provide HD upgraded display-p3 colors

use astro to build docsite

currently using vite and a single html and css file. would be nice to break out sections into astro components, with scoped generated classnames. hosting on firebase with PR actions would be sweet too =)

touch action props?

they're hard to remember, and sorta act opposite than what you think. we could provide named aliases for "sets" or "certain functionality" that makes it much easier to drop these in.

.map {
  touch-action: var(--touch-action-custom-touch-y-handling);
}

test out using a multiplier in the fluid sizes

some of the fluid sizes do most their scaling in the lower widths, while others in the larger widths. using a multiplier in the equation could enable controlling these flow points better, for hopefully a more linear experience between lower and upper bounds.

--font-size-fluid-1: clamp(1rem, 2vw, 1.5rem);

/* becomes */
--fluidity: 2vw;
@media (min-width: 1024px) { --fluidity: 4vw }

--font-size-fluid-1: clamp(1rem, var(--fluidity), 1.5rem);

too much? the fluid props are really fun to use, but i feel it needs a tiny bit more variety and a bit more consistency.

optimize `normalize.css`

there's room to run minifiers heavy on it, so like all border-radius's assignments to the same value are 1 merged selector

Typography vars naming

I've always disliked using kerning and leading for web vars.. it's not really those.. The "make this a webby library" part of my goals makes me want to name them line height and letter spacing, but the industry has been using the traditional typography names for years.

thoughts?

Consolidate gradients

devs shouldnt even know whether or not this lib provided a conic, linear or radial gradient right? if the primary use case will be "let me try on all 30 of these and see which i like", why not offer less gradients at better quality.

Current: 90 gradients, 30 radial (todo), 30 linear, 30 conic
Proposed: 30 gradients, the best of the bunch (prolly mostly conics, some opposing radial gradients, and a few linear ones)

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.