npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ih-ng-css-utility

v0.0.8

Published

A simple utility that provides you some directives to set some basic CSS at run time

Downloads

47

Readme

IH NG CSS Utility

This is like a plug-and-play library that provides multiple directives. Each directive is a CSS helper to set CSS on DOM dynamically and on run time.

Features

  • Set CSS dynamically on run time.
  • No need of bootstrap, tailwind, css file, scss functions, or material utility classes

Available Utility Directives

  • ihPM For setting padding or margin or both
  • ihBR For setting border radius
  • ihHW For setting height or width or both
  • ihFW For setting Font Weight
  • ihFS For setting Font Size
  • ihFlex For setting Flex properties

Other utilities are in Queue, Hopefully, you'll get 2 utilities per minor version they are coming on every weekend.

How to Install

npm i ih-ng-css-utility

OR

pnpm add ih-ng-css-utility

Setup

import { IHCssUtilityModule } from 'ih-ng-css-utility';

@NgModule({
  imports: [
    ...,

    IHCssUtilityModule,
  ],
  ...
})
class YourModule {}

How to Use

// [ihPM] directive for providing padding and margin // here 'pValue' is for padding value and 'mValue' is for margin value
<div ihPM pValue="1rem" mValue="1rem"></div>

// you can provide value for 'top', 'right', 'bottom', and 'left' in CSS way, see below
<div ihPM pValue="1rem 1rem 1rem 1rem" mValue="1rem 1rem"></div>

// [ihBR] directive for providing border-radius
<div ihBR="1rem"></div>

// [ihFW] directive for providing font-weight
<span ihFW="600">Some Text Here</span>

// [ihFS] directive for providing font-size
<span ihFS="large">Some Text Here</span>

// [ihHW] directive for providing width or height
<div ihHW hValue="1rem" wValue="10px"></div>

// [ihFlex] directive for display Flex and its properties
<div ihFlex flexDirection="row" justifyContent="space-between"></div>

Options

If you are curios about Interfaces here is the Reference

type UnitType = "px" | "em" | "rem" | "%" | "pt" | "vw" | "vh" | "";

/**
 * This is the type for input value just like CSS accept value for border-radios
 */
export type BorderRadiusValueType = `${number}${UnitType}` | `${number}${UnitType} ${number}${UnitType}` | `${number}${UnitType} ${number}${UnitType} ${number}${UnitType}` | `${number}${UnitType} ${number}${UnitType} ${number}${UnitType} ${number}${UnitType}`;

/**
 * This is the type for input value just like CSS accept value for padding, margin, border-radios
 */
export type PaddingMarginValueType = BorderRadiusValueType | `-${number}${UnitType}` | `-${number}${UnitType} -${number}${UnitType}` | `-${number}${UnitType} -${number}${UnitType} -${number}${UnitType}` | `-${number}${UnitType} -${number}${UnitType} -${number}${UnitType} -${number}${UnitType}`;

/**
 * This is the type for input value just like CSS accept value for height and width
 */
export type HeightWidthValueType = `${number}${UnitType}`;

/**
 * This is the type for input value just like CSS accept value for font weight
 */
export type FontWeightValueType = "unset" | "normal" | "revert" | "lighter" | "initial" | "inherit" | "bold" | "bolder" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";

/**
 * This is the type for input value just like CSS accept value for font size
 */
export type FontSizeValueType = `${number}${UnitType}` | "initial" | "inherit" | "unset" | "medium" | "revert" | "large" | "larger" | "x-large" | "xx-large" | "xxx-large" | "small" | "smaller" | "x-small" | "xx-small";

Reach me out