Skip to content

Commit

Permalink
feat: remove fonts from package, update ActionBar, Button and InfoLab…
Browse files Browse the repository at this point in the history
…el (#908)

* Fonts are no longer included in each component, follow instruction in readme to include fonts in your own project. 
* New peer dependency on @sap-theming/theming-base-content
* Counter
    * moved from `Badge` folder to `Counter` folder - import as `import { Counter } from 'fundamental-react/Counter'`
* Badge, Label
    * removed, use new InfoLabel component
* ActionBar
    * Removed ActionBar.Back, ActionBar.Header, ActionBar.Actions component, now built into ActionBar via props
* Button
    * `option=‘light’` to `option=‘transparent’`
  • Loading branch information
jbadan authored Mar 4, 2020
1 parent 3935f5f commit e3e6c9a
Show file tree
Hide file tree
Showing 120 changed files with 3,011 additions and 2,907 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# Readme copy for github pages site
/src/_playground/documentation/Home/README.md

# fonts for documentation site
/src/_playground/static/

#index files
/src/**/index.js

Expand Down
2 changes: 1 addition & 1 deletion .size-limit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name: "Fundamental-React Size",
webpack: true,
path: "lib/index.js",
limit: "200 KB"
limit: "185 KB"
}
]
29 changes: 29 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<style type="text/css">
@font-face {
font-family: '72';
src: url('./72-Regular.woff') format('woff');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: '72';
src: url('./72-Light.woff') format('woff');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: '72';
src: url('./72-Bold.woff') format('woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'SAP-icons';
src: url('./SAP-icons.woff') format('woff');
font-weight: normal;
font-style: normal;
}
</style>
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Fundamental React

[![npm version](https://badge.fury.io/js/fundamental-react.svg)](//www.npmjs.com/package/fundamental-react)
[![Minified Size](https://badgen.net/bundlephobia/min/fundamental-react)](https://bundlephobia.com/result?p=fundamental-react)
[![Minified Size](https://badgen.net/bundlephobia/min/fundamental-react)](https://bundlephobia.com/result?p=fundamental-react)
[![Minzipped Size](https://badgen.net/bundlephobia/minzip/fundamental-react)](https://bundlephobia.com/result?p=fundamental-react)
[![Build Status](https://travis-ci.org/SAP/fundamental-react.svg?branch=master)](https://travis-ci.org/SAP/fundamental-react)
[![Coverage Status](https://coveralls.io/repos/github/SAP/fundamental-react/badge.svg?branch=master)](https://coveralls.io/github/SAP/fundamental-react?branch=master)
Expand Down Expand Up @@ -45,6 +45,25 @@ For an existing react application, follow the steps below:
> **NOTE:** Importing from specific component is recommended. Doing so will bring in only the component you are using instead of the whole library, which will reduce your bundle size significantly.
1. This project does not contain fonts and icons - they must be added to your project separately. Fonts and icons can be found at [`@sap-theming/theming-base-content`](https://github.com/SAP/theming-base-content). After importing fonts and icons from [`@sap-theming/theming-base-content`](https://github.com/SAP/theming-base-content), add the following to your css:
```
@font-face {
font-family: "72";
src: url("path/to/fonts") format("woff"); // Bold, Light, Regular available in woff and woff2
font-weight: normal;
font-style: normal;
};

@font-face {
font-family: "SAP-icons";
src: url("path/to/icons") format("woff"); // available in woff, woff2 and ttf
font-weight: normal;
font-style: normal;
}
```
Additionally, edit your webpack configuration to load font and icon fonts - see [file-loader](https://webpack.js.org/loaders/file-loader/).
## Versioning
Expand Down
Loading

0 comments on commit e3e6c9a

Please sign in to comment.