Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svhighlight

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svhighlight

A code highlighter for SvelteKit using highlight.js and TailwindCSS.

  • 0.5.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
483
decreased by-46.69%
Maintainers
1
Weekly downloads
 
Created
Source

SvHighlight - Code Highlighting with Svelte

A code syntax highlighter for Svelte, with line blur and highligthing and focus buttons. The component can be easily customized with TailwindCSS.

  • Documentation
  • Github

Features

  • ✅ line numbers toggle
  • ✅ highlighting lines / blur out non-highlighted lines
  • ✅ hovering over blurred area unblurs the code
  • ✅ copy button
  • ✅ focus blocks and buttons to focus your reader's attention
  • ✅ customizable

Installation

pnpm add svhighlight

For this package you also need highlight.js:

pnpm add highlight.js

Additionally install TailwindCSS.

In your tailwind.config.cjs file add the following line "./node_modules/svhighlight/**/*.svelte" to the content, so it looks like this:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    './src/**/*.{html,js,svelte,ts}',
    "./node_modules/svhighlight/**/*.svelte"
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Example Screenshots

Focus Blocks

Focus Blocks

Blur

Blur

Highlighting

Highlighting

Keywords

FAQs

Package last updated on 02 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc