🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

houdini-dash-border

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

houdini-dash-border

Dashed borders in CSS with custom length, gap, and rounded ends

1.1.0
latest
Source
npm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Houdini Dashed Border

Dashed borders in CSS with custom length, gap, and rounded end caps.

CSS Custom Property NameTypeDescriptionDefault
--border-thicknessnumberThe thickness of the border drawn, in pixels2
--border-lengthnumberThe length of a dash, in pixels12
--border-gapnumberThe gap in-between each dash, in pixels5
--border-dash-capround | square | buttThe end cap type for each dash.round
--border-colorcolorThe color of the border.lightgrey

Usage

🚧 Work in progress.

Solid Border

To turn off dashes, set the --border-gap to 0.

Hover Example

Often you'll want to have a dashed border by default and then on hover change the border to a solid line of a different color:

div {
  --border-thickness: 2;
  --border-length: 12;
  --border-gap: 5;
  --border-dash-cap: round;
  --border-color: lightgrey;

  background: paint(dashed-border);
}

div:hover {
  --border-thickness: 3;
  --border-length: 100;
  --border-gap: 0;
  --border-color: #f8e515;

  background-color: #ffffef;
  cursor: pointer;
}

Demo

CodePen Demo

Currently, only Chrome and Edge support the required Paint API. This will not work in Safari or Firefox.

Todo

  • Add option to change border radius (--border-radius)
  • Add option for multiple gap and length sizes of dashes
  • Add random dash length and gap option
  • Animate custom property changes.

Keywords

houdini

FAQs

Package last updated on 25 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts