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

frigattos

v2.1.0

Published

Frigatto'sis an intuitive and easy-to-use SCSS library to help you write your stylesheets, providing functions for font configuration, flexbox, position, etc

Downloads

4

Readme

Frigatto's

Frigatto's is an intuitive and easy-to-use SCSS library to help you write your stylesheets, providing functions for font configuration, flexbox, position, etc

Credits

Author: Alberto Frigatto

Email: [email protected]

Linkedin: Click Here

Table of Contents

Quick start

download the library here via:

git clone https://github.com/Alberto-Frigatto/Frigattos.git
npm i frigattos

In a SCSS file import the library:

@use 'path_to_library/frigattos';

Usage

The library itself will produce a basic setup resetting the style of HTML tags

Functions

Border radius

The library provides functions for border radius:

element {
  @include frigattos.radius-top($radius);
}

Rounds the top border of the element

Parameters

  • $radius: length units
element {
  @include frigattos.radius-bottom($radius);
}

Rounds the bottom border of the element

Parameters

  • $radius: length units
element {
  @include frigattos.radius-left($radius);
}

Rounds the left border of the element

Parameters

  • $radius: length units
element {
  @include frigattos.radius-right($radius);
}

Rounds the right border of the element

Parameters

  • $radius: length units

Flexbox

The library provides functions for flexbox:

element {
  @include frigattos.center;
}

Turns the element into a flex container with centered items

element {
  @include frigattos.column-center;
}

Turns the element into a column flex container with the items aligned to the center

element {
  @include frigattos.column;
}

Turns the element into a column flex container

Fonts

The library provides a function for including and configuring fonts:

Fonts available in the library:

Fonts are taken from Google Fonts

@include frigattos.include-fonts($fonts...);

Parameters

  • $fonts: string or map - arbitrary argument

Using with string

Including only one font:

// By name
@include frigattos.include-fonts('poppins');
@include frigattos.include-fonts('ibm plex mono');
@include frigattos.include-fonts('roboto slab');

// By type
@include frigattos.include-fonts('handwriting'); // dancing script
@include frigattos.include-fonts('monospace'); // ibm plex mono
@include frigattos.include-fonts('sans serif'); // lato

Including only one font per string, in addition to including it, it will also be set as the default font for texts and titles

⚠️ If you just want to include a single font without setting it as the default font, use the function with maps


Including more than one font:

// By name
@include frigattos.include-fonts('roboto', 'lora');

// By type
@include frigattos.include-fonts('handwriting', 'serif');

Including more than one font per string, the function will only import the fonts without defining them in any tag

⚠️ If you want to include more than one font and define them, use the function with maps

Using with map

To include a font, the map must have two properties:

  • name - font name or type
  • define - Where the font will be set

Define values

  • full typography - Defines the font for text tags (p, span, blockquote...) and heading (h1-h6)
  • headings - Defines the font for heading tags (h1-h6)
  • text - Defines the font for text tags (p, span, blockquote...)
  • code - Defines the font for code tags (code, samp, kbd)
  • none - Only import

Examples:

@include frigattos.include-fonts(
  (
    name: 'noto sans',
    define: 'text'
  ),
  (
    name: 'serif',
    define: 'headings'
  ),
  (
    name: 'roboto mono',
    define: 'code'
  )
);

Geometric shapes

The library provides functions for geometric shapes:

element {
  @include frigattos.square($width, $background, $radius: .4rem);
}

Creates a square

Parameters

  • $width: length units
  • $background: color
  • $radius: length units - default value: .4rem
element {
  @include frigattos.circle($width, $background);
}

Creates a circle

Parameters

  • $width: length units
  • $background: color

Images

The library provides functions for images:

img {
  @include frigattos.cut-img($width, $height, $fit: cover, $position: center);
}

Cut the image

Parameters

  • $width: length units
  • $height: length units
  • $fit: object-fit values - default value: cover
  • $position: object-position values - default value: center

Position

The library provides functions for position:

element {
  @include frigattos.position-center($position: absolute);
}

Positions the element in the center of its container

Parameters

  • $position: position values - default value: absolute
element {
  @include frigattos.position-top-left($position: absolute, $top: 0, $left: 0);
}

Positions the element based on top and left

Parameters

  • $position: position values - default value: absolute
  • $top: length units - default value: 0
  • $left: length units - default value: 0
element {
  @include frigattos.position-top-right($position: absolute, $top: 0, $right: 0);
}

Positions the element based on top and right

Parameters

  • $position: position values - default value: absolute
  • $top: length units - default value: 0
  • $right: length units - default value: 0
element {
  @include frigattos.position-bottom-left($position: absolute, $bottom: 0, $left: 0);
}

Positions the element based on bottom and left

Parameters

  • $position: position values - default value: absolute
  • $bottom: length units - default value: 0
  • $left: length units - default value: 0
element {
  @include frigattos.position-bottom-right($position: absolute, $bottom: 0, $right: 0);
}

Positions the element based on bottom and right

Parameters

  • $position: position values - default value: absolute
  • $bottom: length units - default value: 0
  • $right: length units - default value: 0

Scrollbar

The library provides a function for scrollbar:

element {
  @include frigattos.include-scrollbar($thumb-background, $track-background, $width: 1rem)
}

Defines a scrollbar for the element

Parameters

  • $thumb-background: color
  • $track-background: color
  • $width: length units - default value: 1rem

Thanks for using my library 😃