Socket
Socket
Sign inDemoInstall

@algolia/fragments.js

Package Overview
Dependencies
100
Maintainers
73
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @algolia/fragments.js

The Fragments atomic CSS system, rebuilt in Nodejs


Version published
Weekly downloads
131
decreased by-23.39%
Maintainers
73
Install size
14.4 MB
Created
Weekly downloads
 

Readme

Source
Fragment.js cover image

Fragments.js is a Nodejs implementation of Fragments.css, an atomic css framework that aims to make developers' lives easier.

Made for all usecases

One of the advantages of choosing Fragments.js to build your UIs is that it's fully customizable from one and only entry point. Head to the fragments.config.js and adjust the template with your own colors, fonts and styles, which will then be propogated to the compiled CSS.

Using Fragments.js

Note that we're using yarn for these examples, but you can of course use the npm equivalent.

Getting started

yarn add @algolia/fragments.js

To initialise the fragments.config.js, run the following:

fragments init

Make sure to edit the newly created fragments.config.js file in your root directory, after which you can run:

fragments build [destination]

This will output fragments.css with your configuration, into the destination folder, which defaults to /dist.

If you're having troubles making it work and getting command not found, try running the command using either node_modules/.bin/fragments <command> [options] or npx.

Versions

Do your edits, then:

  • Open a new pull request from the branch holding your changes to master

Once your PR has been merged:

  • git checkout master && git pull origin master
  • Bump the version in the package.json
  • npm publish
  • git add . && git commit -m"bumped version <version>" && git push origin master

If you edited the docs:

  • yarn docs:build

Usage

Example usage in React:

import React from 'react';
import '~/dist/fragments.css';

const App = () => (
  <div className="bgc-cosmos">
    <p className="color-white fsz-24 ta-center">
      Hello world, using <b>Fragments.js</b>
    </p>
  </div>
);

export default App;

FAQs

Last updated on 09 Feb 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc