@loomhq/lens
TypeScript icon, indicating that this package has built-in type declarations

11.1.0 • Public • Published

Lens — the design system for Loom products

npm

Installation

Add Lens to your app:

yarn add @loomhq/lens

Add dependencies:

yarn add @emotion/core
yarn add @emotion/styled

Install CSS variables

getThemeStylesString() and getAllCssVarsString() return strings that contain all CSS variables. Use these functions and inject the output to a style tag in the head:

import { getThemeStylesString, getAllCssVarsString } from '@loomhq/lens'

const style = document.createElement('style');
style.innerHTML = getThemeStylesString() + getAllCssVarsString();
document.head.appendChild(style);

In some cases you might need to inject the CSS variables to a specific element. Pass a string argument to getThemeStylesString() and getAllCssVarsString():

getThemeStylesString('.myGlobalElement')
getAllCssVarsString('.myGlobalElement')

Install CSS utilities

CSS classes are exported as a string and can be injected to a style tag in the head:

import { cssUtilities } from '@loomhq/lens'

const style = document.createElement('style');
style.innerHTML = cssUtilities();
document.head.appendChild(style);

Running Locally

pnpm i
pnpm dev
navigate to: http://localhost:3000

Contributing

Please surface any urgent pull requests in #lens-designsystem.

Use conventional commits

Use conventional commitsmessages. Once the PR is merged it will kick off publishing a new version of Lens in npm.

Upgrading Lens versions

loom

From the root of the main Loom repo

  1. Move into the webapp-client directory.
cd projects/webapp-client
  1. Upgrade the Lens package with pnpm (you can ignore the warnings).
pnpm up -r @loomhq/lens --latest

This tells pnpm to find all packages in the workspace that use lens, and upgrade them all to the latest version

  1. From the root, fix dependencies and upgrade Lens globally
cd ... && pnpm deps:fix && pnpm i

This shouldn't be necessary, but will correct any blocking issues.

Issue: If you're still having issues accessing new imports or code features from Lens after the above commands, make clean-node-deps in root of the repo and then reinstall everything with pnpm i.

  1. Run changesets so that it generates the necessary .md file for release.
pnpm changeset
  1. Follow the prompts. Hit Spacebar to select all changed packages. The checks should turn green. Hit Enter to commit.
🦋  Which packages would you like to include?
✔ changed packages
  ✔ @loomhq/web-client
  1. Skip major bump. Hit Enter to bypass.
🦋  Which packages should have a major bump? …
  1. Skip minor bump. Hit Enter to bypass.
🦋  Which packages should have a minor bump? …
  1. For patch bump, you will be prompted to write a description.
The following packages will be patch bumped:
🦋  @loomhq/web-client@0.0.6
🦋  Please enter a summary for this change (this will be in the changelogs). Submit empty line to open external editor
🦋  Summary › [description goes here, enter to complete]
  1. Write a concise note like bump Lens v[X.X.X] to add SvgIconName

  2. You will be asked asked if this is your desired change. Type 'Y'.

All dependents of these packages that will be incompatible with the new version will be patch bumped when this changeset is applied.

🦋  Is this your desired changeset? (Y/n) › [type Y]
  1. A new randomly-named .md file should be generated into the changesets directory. Commit this file to your changes.

  2. For any changes to existing components, do your due diligence and check the component changes locally within the repo.

Add an icon to the icon set

Once you have the SVG of the new icon to be added, make sure all strokes are outlined. Set <svg> attributes to viewBox="0 0 24 24" fill="none" {...props} and <path> attributes to fill="currentColor". Follow this for an example PR or watch https://www.loom.com/share/26e36c6616be4db386192467b88edbc9 for a step-by-step walkthrough.

Documentation

https://lens.loom.dev

Readme

Keywords

none

Package Sidebar

Install

npm i @loomhq/lens

Weekly Downloads

2,828

Version

11.1.0

License

ISC

Unpacked Size

1.36 MB

Total Files

925

Last publish

Collaborators

  • samc-atla
  • josecarlosatloom
  • maitrishah
  • victorlee134
  • nathanchungloom
  • rbutler-loom
  • ploom
  • sjhsieh.loom
  • njain-loom
  • jmreidy
  • loomit
  • rekharameshloom
  • daniel.semmel
  • yiming-loom
  • vinraju-loom
  • parimal.singh
  • mgranmoe
  • imartinezmorales-loom
  • ayushgr.loom
  • romaindejean58
  • davidfyu
  • harrisonnovak
  • rahirikar
  • peterheesterman
  • steveatloom
  • dainguyendo-loom
  • complicated-cog
  • gchildsloom
  • garshythoel
  • anthonyloom
  • swac-loom
  • yoannloom
  • avanikaloom
  • amanda-loom
  • loom-infra-robot
  • lingrino
  • brett-loom
  • ilyalavrenov
  • stuti43
  • gkim795
  • laurabarrera
  • wmiller112
  • sadebrowne
  • emilyteng
  • joeyma22
  • yoichi
  • pjang-loom
  • nathanthomas
  • andi-ni-loom
  • jflashlight
  • dkim96
  • btuttle
  • brian-nguyen-loom
  • maitri.shah
  • jose.medina
  • ben.lo
  • sergioloom
  • dainguyendo
  • tatiana_loom
  • jessica.pancer
  • thefriendlyghost
  • josh_loom
  • vinayh
  • loom.embed-sdk
  • nymerias
  • ydep
  • luis.loom
  • premaloom
  • vladloom
  • angelaliu
  • rodrigoloom
  • juliannaroenloom
  • cndreisbach
  • narayangowraj8
  • dj_haile
  • catherinelin
  • andrzej.wisniewski
  • mosesj-loom
  • erinbyerly
  • aditya_singla
  • jiaweiou
  • loominghoward
  • vishalsantoshi
  • wilbertthelam