1.1.1 • Published 7 years ago

@lonelyplanet/common-css v1.1.1

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

common-css

This package provides a common.css file that sets the global styles for a front-end application on lonelyplanet.com.

The stylesheet:

  • uses @font-face to set custom web fonts Benton Sans and Miller Daily
  • sets box-sizing: border-box to normalize the box model
  • includes normalize.css and a custom reset to create a baseline across multiple browsers
  • contains some global helper classes
  • provides some default typographic styling
  • includes print styles

Browser support

Last 3 versions and IE 11 via the browserlist config.

Installation

npm install @lonelyplanet/common-css

Usage

For now, the recommended way to use this package is to include it in a Webpack build.

@import "@lonelyplanet/common-css/dist/common.css";

Scripts

The only script you’ll need to run is build.

ScriptDescription
startRuns the package in “development mode”; opens the preview HTML file and runs Webpack with the --watch flag to recompile as changes are made, however, the HTML must be manually refreshed after each change
buildCompiles the CSS file to the dist directory
previewCompiles the CSS file and opens an HTML file where the styles can be previewed; this script is run as part of the start script
stylelintLints the CSS source files
testRuns the stylelint script
prepublishOnlyRuns the build script before the package is prepared and packed, only on npm publish
precommitRuns the test script before a commit is made

Dependencies

PackageDescription
@lonelyplanet/design-tokensThis package contains the design tokens (styles) used across Lonely Planet’s digital products; it’s part of the Backpack monorepo.
@lonelyplanet/browserslist-configThis package contains information about Lonely Planet’s browser support for Autoprefixer.
normalize.cssNormalize.css makes browsers render all elements more consistently and in line with modern standards. It is used in place of a full CSS reset.
PostCSSPostCSS is a tool for transforming styles with JS plugins. Plugins include postcss-calc, postcss-custom-media, postcss-custom-properties and postcss-import. The separate CLI tool for PostCSS is also installed.
AutoprefixerAutoprefixer is a PostCSS plugin that parses CSS and adds vendor prefixes to CSS rules using values from the Can I Use website.
cssnanocssnano is CSS minifier built on top of the PostCSS ecosystem.
WebpackWebpack is a module bundler for the web. Loaders include css-loader, extract-text-webpack-plugin, postcss-loader and style-loader. The separate CLI tool for Webpack is also installed.
StylelintStylelint is a linter tool for CSS files; it has been configured to use stylelint-config-standard.
pre-commitpre-commit automatically installs pre-commit hooks which runs npm scripts before a commit is made.

Contributing

Please read the contributing document before writing any code.

License

MIT License

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago