New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

beautify-html

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beautify-html

A simple customisable NPM package 📦 to instantly beautify boring HTML documents 🎨

Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

beautify-html 🎨

A simple customisable NPM package 📦 to instantly beautify boring HTML documents 🎨

Install

Using npm:

npm i beautify-html

Setting up

Import the package with ES6 modules:

import beautify from "beautify-html";

Include the js file in the HTML document:

<script type="module" src="yourfile.js"></script>

Apply the styling

To apply the styling, call the beautify function with the type of theme you want and primary color.

Syntax

beautify(theme, color, [, optIn?: boolean])

Examples

import beautify from "beautify-html";

// light theme with blue primary color
beautify("light", "blue");

// dark theme with purple primary color
beautify("dark", "purple");

Before

Screen Shot 2021-03-25 at 17 10 45

After

Screen Shot 2021-03-25 at 15 59 09 Screen Shot 2021-03-25 at 15 58 58

List of themes and colors

Themes:

  • light
  • dark

Colors:

  • blue
  • red
  • purple
  • green
  • orange

Using classes

You can opt in into styling the document per element, similary of how you would use bootstrap for example.

Attributes included are:

  • .beautify-text
  • .beautify-title
  • .beautify-input
  • .beautify-button
  • .beautify-link
  • .beautify-hr
  • .beautify-table
  • .beautify-ul

Examples

import beautify from "beautify-html";

// setting the opt in parameter to true will enable
// stying only to selected elements
beautify("light", "blue", true);
<body>
  <h1 class="beautify-title">Lorem Ipsum</h1>
  ...
  <form method="get">
    ...
    <input class="beautify-input" type="text" />
    ...
    <input class="beautify-button" type="submit" />
    ...
  </form>
  ...
</body>

License

MIT

Keywords

css

FAQs

Package last updated on 25 Mar 2021

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