@foeewni/web-core
Friend of the Earth EWNI Core for frontend projects
Last updated 3 days ago by luigimannoni .
ISC · Repository · Original npm · Tarball · package.json
$ cnpm install @foeewni/web-core 
SYNC missed versions from official npm registry.

Codacy Badge Node requirement npm version

FOE EWNI Frontend Core ????

This repo contains the build for all the frontend core elements, the repo is split in different "bundles" and compiled through Webpack4. Refer to the Bundles section below

How to build

npm install then npm run build

Launching Dev

npm start launches a Webpack dev server instance with HMR (hot module replacement), the dev server runs on http://localhost:9000, livereload listens to port 9001.

Bundles

The following bundles are available to ease embedding the styles and javascripts on other projects, those bundles are not to be taken as "absolute truth" as in components will vary between sites (for example one could say that forms on Campaignion are part of the critical CSS while won't be on D8 sites.)

Bundles below are for generic use, these are mostly tuned for Drupal 8 sites (main and satellites), for more granularity please import the single components on your builder.

Critical (critical.js)

This is the most important CSS and JS bundle to deliver to the browser as soon as possible.

Embed normally as such:

<link rel="stylesheet" href="/path/to/foe.critical.min.css" />
<script type="text/javascript" src="/path/to/foe.critical.min.js" />

Contains reset and typography, async fonts, bootstrap grid and utilities as well as hero and menu components. This bundle priorotises over-the-fold components and most layout sizing to prevent FOUC (flash of unstyled content) as much as possible. The critical bundle is tuned specifically for our main Drupal sites.

Main (main.js)

This is the generic bundle, this contains all other components such as forms, inputs, paragraphs, sidebars, campaign menus, etc.

Embed with deferred/preload strategy as such:

<link rel="preload" as="style" href="/path/to/foe.main.min.css" media="screen" onload="this.rel = 'stylesheet'" />
<script type="text/javascript" src="/path/to/foe.main.min.js" defer />

Fonts (fonts.js)

The Fonts bundle contains a preloader for the google fonts as well as Font Awesome fonts.

Extras (extras.js)

Ultimately the Extras bundle contains all other remaining components which are not in any way required from anonymous visitors, this bundle will append any style needed only from logged-in admins Load as last, use server-side logic to detect logged in users.

Deprecated Bundles

These bundles are here for retrocompatibility reasons and to prevent sites embedding the library from unpkg using versioning @latest, they are deprecated and will issue a warning if used. They will be removed completely in a future version.

Core (core.js)

Contains typography, fonts, forms and general colour appearance.

Components (components.js)

Contains components such as navbar, hero, etc. The source is dependent from core but compiled as a standalone

Drupal Frontend (drupal.js)

Contains customisation for the Drupal admin bars to work seamlessly with our Frontend elements. The source is dependent from core but compiled as a standalone

Bootstrap JS (bootstrap.js)

Contains all the classes/display utilities we need from bootstrap (with the exception of some components we don't use, such as the carousel)

How to include in a project

Javascript

Simply import the compiled JS from the NPM build itself, eg: import '@foeewni/web-core/dist/js/foe.xxx.min' where XXX is one of the bundles above.

SCSS

For SCSS you can either import the compiled CSS from the dist folder (nb: you wont access the SCSS vars in this way) Or import the actual entry files for the source SCSS, take note the global variables are all stored inside the core bundle. Components, Drupal and Bootstrap bundles are all dependant from the core.

Releasing

Run npm version [major|minor|patch] to bump the semantic versioning details within our package.json and push a commit via the usual PR/code review route (i.e. PR to develop branch, then PR to master.). Check release here https://www.npmjs.com/package/@foeewni/web-core

Current Tags

  • 2.0.4                                ...           latest (3 days ago)

52 Versions

  • 2.0.4                                ...           3 days ago
  • 2.0.3                                ...           8 days ago
  • 2.0.2                                ...           8 days ago
  • 2.0.1                                ...           8 days ago
  • 2.0.0                                ...           9 days ago
  • 1.10.1                                ...           3 months ago
  • 1.10.0                                ...           3 months ago
  • 1.9.0                                ...           3 months ago
  • 1.8.0                                ...           3 months ago
  • 1.7.0                                ...           3 months ago
  • 1.6.8                                ...           4 months ago
  • 1.6.7                                ...           6 months ago
  • 1.6.6                                ...           7 months ago
  • 1.6.5                                ...           a year ago
  • 1.6.4                                ...           a year ago
  • 1.6.3                                ...           a year ago
  • 1.6.2                                ...           a year ago
  • 1.6.1                                ...           a year ago
  • 1.6.0                                ...           a year ago
  • 1.5.3                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Downloads
Today 0
This Week 11
This Month 108
Last Day 2
Last Week 96
Last Month 1
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |