Giter VIP home page Giter VIP logo

pact-styles's Introduction

Pact Styles

A simple Bower package to decentralise our styles. This will install the CSS and font files you need to get started making Pact apps/pages.

Usage

Ember (with ember-cli)

Including CSS

In your ember-cli project’s folder run: bower install pact-styles --save

In Brocfile.js add the following just above module.exports = app.toTree();:

app.import('bower_components/pact-styles/public/css/pact.css');

Start/restart the Ember server; e.g. ember-server

The CSS will be added to /dist/assets/vendor.css automatically

If you used ember-cli to set up the app, vendor.css is included automatically

Including the fonts

Including fonts requires the broccoli-static-compiler: npm install --save broccoli-static-compiler

Add this import to the top of Brocfile.js, just below the EmberApp require:

var pickFiles = require('broccoli-static-compiler');

Add the following to Brocfile.js, just above the module.exports = app.toTree() line:

var fontAssets = pickFiles('bower_components/pact-styles', {
  srcDir: '/public/fonts/',
  files: ['**/*.woff', '**/*.woff2', '**/*.eot', '**/*.ttf', '**/*.svg'],
  destDir: '/assets/fonts'
});

Change module.exports = app.toTree() to module.exports = app.toTree(fontAssets)

Start/restart the Ember server; e.g. ember-server.

The fonts will be added to /assets/fonts/ in the dist directory.

Note on fonts:

The stylesheet expects fonts to be in ./fonts, relative to the generated CSS file, so if you’re including the CSS in a different directory, make sure fontas are imported to fonts/ in the same directory as the CSS file.

pact-styles's People

Contributors

scott-riley avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.