fabric8-pattern.library v2.0.0
fabric8-pattern.library
A pattern library for the fabric8 UI project.
Installation
npm installgulp build- this runs
gulp copyto copy thelessdependencies into the styles directory,gulp lessto compile to.lessfiles intostyles/css/fabric8.min.cssandgulp dependenciesto move the other dependent files into their respective locations.
- this runs
Projects included with this module
Each of these modules is imported into the fabric8.less file and included in the compiled fabric8.min.css file.
Building into your project
To include fabric8-pattern.library in your project, include the following in your project:
Using the @import from {{Less}}:
@import (reference) '/node_modules/fabric8-pattern.library/styles/less/fabric8.less';- make sure the you are backing out to your root level so that you can reach the
fabric8.lessfile in thenode_modulesdirectory
- make sure the you are backing out to your root level so that you can reach the
Using Webpack
This is somewhat specific to the fabric8-ui project, but can be modified to fit other projects.
- import the CSS in vendor.browser.ts
import '/node_modules/fabric8-pattern.library/styles/css/patternfly.min.css'; import '/node_modules/fabric8-pattern.library/styles/css/patternfly-additions.min.css'; import '/node_modules/fabric8-pattern.library/styles/css/fabric8.min.css'; - add the following to your
webpack.common.jsfile:{ loader: 'less-loader', options: { paths: [ path.resolve(__dirname, "../node_modules/fabric8-pattern.library/styles/dependencies"), path.resolve(__dirname, "../node_modules/fabric8-pattern.library/styles/dependencies/patternfly/"), path.resolve(__dirname, "../node_modules/fabric8-pattern.library/styles/dependencies/patternfly/bootstrap/less"), path.resolve(__dirname, "../node_modules/fabric8-pattern.library/styles/dependencies/patternfly/font-awesome/less"), ], sourceMap: true } } - This sets the paths so that the
.lessimports will resolve properly.
Directly in HTML
Include the following files to build the pre-compiled fabric8-pattern.library CSS
<head>
<link href="node_modules/fabric8-pattern.library/styles/css/patternfly.min.css" rel="stylesheet">
<link href="node_modules/fabric8-pattern.library/styles/css/patternfly-additions.min.css" rel="stylesheet">
<link href="node_modules/fabric8-pattern.library/styles/css/fabric8.min.css" rel="stylesheet">
</head>Using Gulp (WIP)
If you want to compile everything from the .less files, add the following compilation task to your gulpfile.js
gulp.task('less', function () {
gulp.src('styles/less/fabric8.less')
.pipe(plumber())
.pipe(less({
paths: [ path.join('node_modules'),
path.join('styles/dependencies/patternfly/'),
path.join('styles/dependencies/patternfly/bootstrap/less'),
path.join('styles/dependencies/patternfly/font-awesome/less')],
}))
.pipe(minifyCSS())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('styles/css'))
});- You will need the following dependencies installed:
Question?
If you have any questions or issues with this module, please file and issue on our GitHub page.
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago