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

sstring

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sstring

A scss library for working with strings

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

sstring

A scss library for working with strings

Install

npm i sstring -D

Usage

Currently sstring consists of two functions only, string-camelize and string-capitalize and they're just doing what the name implies.

Here's how it works at a blush:

@each $name, $value in (
  primary: yellow,
  secondary: peachpuff
) {
  .u-background#{string-capitalize($name)} {
    background: $value;
  }
}


@each $value in (xx-small, x-small, small, medium, large, x-large, xx-large) {
  .u-#{string-camelize(fontSize + '-' + $value)} {
    font-size: $value,
  }
}

Which results in:

.u-backgroundPrimary {
  background: yellow;
}

.u-backgroundSecondary {
  background: peachpuff;
}

.u-fontSizeXxSmall {
  font-size: xx-small;
}

.u-fontSizeXSmall {
  font-size: x-small;
}

.u-fontSizeSmall {
  font-size: small;
}

.u-fontSizeMedium {
  font-size: medium;
}

.u-fontSizeLarge {
  font-size: large;
}

.u-fontSizeXLarge {
  font-size: x-large;
}

.u-fontSizeXxLarge {
  font-size: xx-large;
}

API

string-camelize($string)

Transforms a string to camelCase.

string-capitalize($string)

Capitalizes a string.

Development

In order to run specs, issue the following from your terminal:

npm test

Run dev-server

npm start

Create a build (for whatever purpose)

npm run build

Keywords

scss

FAQs

Package last updated on 05 Feb 2019

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