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

html-dynamic-text-rows

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

html-dynamic-text-rows

A small javascript component for dynamicly resizing text to spread over the entire width of the parent element.

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

HTML Dynamic text rows

Using

Include html-dynamic-text-rows-component.js at the bottom of your page, just before the ending </body> element.

<script src="html-dynamic-text-rows-component.min.js"></script>
<!-- Or, when installed by npm -->
<script src="node_modules/html-dynamic-text-rows-component/html-dynamic-text-rows-component.min.js"></script>

Optional: include html-dynamic-text-rows-component.css (this is only required when you dynamically add a component with the dynamic-text-rows attribute)

<link rel="stylesheet" href="html-dynamic-text-rows-component.min.css">
<!-- Or, when installed by npm -->
<link rel="stylesheet" href="node_modules/html-dynamic-text-rows-component/html-dynamic-text-rows-component.min.css">

When you have loaded the component you can use it as followed:

<div dynamic-title-rows="1">Lorem ipsum</div>

Where the value of dynamic-title-rows equals the amount of rows the text should be expand over.

Issues

None (yet)

Installing

 $ npm install html-dynamic-text-rows-component

About

I made this component as an easy way to make text adaptable to its parent container. It does so by starting from 1px, increasing the font-size till it exceeds the maximum amount of rows. It has a fail safe in case it can not reach the desired amount of rows. This could happen when you input 4 rows, but only apply 3 words. See the example.html to get a preview of the functionality and use it to experiment.

Keywords

dynamic

FAQs

Package last updated on 13 Dec 2020

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