@algolia/fragments.js

2.0.0-beta.17 • Public • Published
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;

Readme

Keywords

none

Package Sidebar

Install

npm i @algolia/fragments.js

Weekly Downloads

197

Version

2.0.0-beta.17

License

MIT

Unpacked Size

197 kB

Total Files

105

Last publish

Collaborators

  • wwalser
  • jkaho
  • mprevell97
  • louishousiaux
  • antoine.gilles
  • eventexperiences_algolia
  • jsok_algolia
  • bhinchley-algolia
  • hugowit
  • alg-admin
  • aymeric.giraudet
  • gavinwade12
  • bhcastle
  • rishi_algolia
  • jasonberry
  • scyganek-algolia
  • drodriguln
  • abodelot
  • leviwhalen
  • sfaiqh
  • valentindotxyz
  • fluf
  • instantsearch-bot
  • taylorcjohnson_algolia
  • pjankowski5312
  • raed-algolia
  • dylantientcheu
  • catalgolia
  • morgan-algolia
  • algabet
  • andy_ds
  • bengreenbank
  • alg-bgastinne
  • daltondickalgolia
  • jcohonner-algolia
  • robertmogos
  • mariaalungu
  • emmanuel.fortin
  • ejaldorau
  • dhaya.b
  • lukyvj
  • marielaure
  • haroenv
  • rayrutjes
  • jerska
  • ronanlevesque
  • samouss
  • therealwebby
  • francoischalifour
  • jonmontane
  • tkrugg
  • seafoox
  • sylvainh
  • clemfromspace
  • lorrissaintgenez
  • broujo
  • e-krebs
  • kombucha
  • sylvain
  • crawler-team
  • amcdaid106
  • devinalgolia
  • jvenezia
  • otomatik
  • sophiem03
  • sarahdayan
  • dcoates
  • maximehuang
  • guitek
  • matthewbond
  • cyril.descossy
  • tatsuro
  • danajeremy
  • mathougui
  • xavdh
  • agdavid
  • rasemotte
  • plnech
  • shortcuts
  • praagyajoshi
  • loicsay
  • svensoldin
  • alphonseb
  • leodau
  • fabienmotte
  • sarahfranc
  • millotp