Home

Awesome

Fundamental Library Styles

<a href="https://badge.fury.io/js/fundamental-styles"><img src="https://badge.fury.io/js/fundamental-styles.svg" alt="NPM Version"/></a> <img src="https://github.com/SAP/fundamental-styles/actions/workflows/create-release.yml/badge.svg?branch=main" alt="CI Status"/> <img src="https://img.shields.io/npm/dm/fundamental-styles?label=npm%20downloads" alt="NPM Downloads"> <a href="https://join.slack.com/t/ui-fundamentals/shared_invite/enQtNTIzOTU0Mzc2NTc5LWQzZWI5MWFhYjE5OTc4YzliN2JhOTc1ZjQxZTg1YjZiMWZiYzRkNjMwYzgyMmFkYmNhZDVjMWE5MDIzOWEzMmM"> <img src="https://img.shields.io/badge/slack-ui--fundamentals-blue.svg?logo=slack" alt="Slack"> </a> <a href="https://api.reuse.software/info/github.com/SAP/fundamental-styles"> <img src="https://api.reuse.software/badge/github.com/SAP/fundamental-styles" alt="REUSE status"> </a> <a href="https://storybook.js.org/"> <img src="https://raw.githubusercontent.com/storybookjs/brand/main/badge/badge-storybook.svg" alt="StorybookJS"/> </a>

<a href="https://www.netlify.com"> <img src="https://www.netlify.com/img/global/badges/netlify-light.svg" alt="Deploys by Netlify" /> </a>

What is Fundamental Library Styles?

Fundamental Library Styles is a lightweight presentation layer that can be used in conjunction with any UI framework, such as Angular, React, Vue, etc. By utilizing the Fundamental Styles library, which includes a collection of stylesheets and HTML tags, developers can create visually consistent and professional-looking Fiori applications in any web-based technology of their choice.

We are also working on Angular , React and Vue implementations.

Getting Started

The library is modular, so you can use as little or as much as you need.

CDN

The fully compiled, minified library is available via unpkg CDN for inclusion in your application.

For prerelease version use

<link href='https://unpkg.com/fundamental-styles@prerelease/dist/fundamental-styles.css' rel='stylesheet'>

For latest stable version use

<link href='https://unpkg.com/fundamental-styles@latest/dist/fundamental-styles.css' rel='stylesheet'>

You can also include specific version of library into your html via using

<link href='https://unpkg.com/fundamental-styles@{versionNumber}/dist/fundamental-styles.css' rel='stylesheet'>

where you should replace {versionNumber} with desired version number. For example with 0.20.3

Theming

To use particular theme you need to include two CSS variables files:

<link href='https://unpkg.com/@sap-theming/theming-base-content/content/Base/baseLib/{themeName}/css_variables.css' rel='stylesheet'>
<link href='https://unpkg.com/fundamental-styles@{versionNumber}/dist/theming/{themeName}.css' rel='stylesheet'>

Available values for themeName are sap_horizon, sap_horizon_dark, sap_horizon_hcb, sap_horizon_hcw, sap_horizon_set, sap_fiori_3, sap_fiori_3_dark, sap_fiori_3_hcb, sap_fiori_3_hcw, sap_fiori_3_set, sap_fiori_3_light_dark

NPM Package

The compiled CSS for the full library and modules, e.g., core, layout, etc., are distributed via NPM.

npm install fundamental-styles --save

NOTE: We only distribute compiled CSS for each component, not the full project or HTML for specific components.

Icons

See the Icon Component for a list of icon class names. See Project Configuration below for instructions to include SAP Fiori icons in your project.

Project Configuration

This project does not contain fonts and icons - they must be added to your project separately. Download the @sap-theming library. After adding fonts and icons to your project, include the following in your CSS(The icon font files have different design for Fiori 3 themes and they can be found in the folder @sap-theming/theming-base-content/content/Base/baseLib/baseTheme/fonts/):

@font-face {
    font-family: "72";
    src: url("~@sap-theming/theming-base-content/content/Base/baseLib/baseTheme/fonts/72-Regular-full.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "72";
    src: url("~@sap-theming/theming-base-content/content/Base/baseLib/baseTheme/fonts/72-Bold-full.woff") format("woff");
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: "72";
    src: url("~@sap-theming/theming-base-content/content/Base/baseLib/baseTheme/fonts/72-Light-full.woff") format("woff");
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: "SAP-icons";
    src: url("~@sap-theming/theming-base-content/content/Base/baseLib/sap_horizon/fonts/SAP-icons.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BusinessSuiteInAppSymbols';
    src: url('~@sap-theming/theming-base-content/content/Base/baseLib/sap_horizon/fonts/BusinessSuiteInAppSymbols.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'SAP-icons-TNT';
    src: url('~@sap-theming/theming-base-content/content/Base/baseLib/sap_horizon/fonts/SAP-icons-TNT.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

html {
    font-size: 16px;
}

Working with the Project

Download and Installation

  1. Clone Repository Clone the repo using the git software of your choice or using the git command git clone https://github.com/SAP/fundamental-styles.git

  2. Install NPM Dependencies: npm install

  3. Serve the development playground and documentation website locally

    1. If you want to serve with development environment run npm start
    2. For production build serve run npm run start:prod

Project Dependencies

The project has the following prerequisites:

SLA

Our Service Level Agreement. Fundamental Library Styles is aiming to deliver:

SLA - What

SLA - How

This library is also being consumed by Fundamental Library for Angular , Fundamental Library for React, and Fundamental Library for Vue.

The above SLA is the primary difference between this library and the earlier Fundamental.

Support

If you encounter an issue, you can create a ticket or post on the Fundamentals Slack channel .

Contributing

If you want to contribute, please check the SAP Contribution Guidelines, the Contribution Guidelines. Also check the Development Guidelines and Visual Testing Guide.

Versioning

The fundamental-styles library follows Semantic Versioning. These components strictly adhere to the [MAJOR].[MINOR].[PATCH] numbering system (also known as [BREAKING].[FEATURE].[FIX]).

Merges to the main branch will be published as a prerelease. Pre-releases will include an rc version (_ e.g._ [MAJOR].[MINOR].[PATCH]-rc.[RC]).

The following circumstances will be considered a MAJOR or BREAKING change:

The following circumstances will NOT be considered a MAJOR or BREAKING change:

Fundamental Library GitHub Repository

The Fundamental Library GitHub Repository is a monorepo package that allows the reusage of other packages while keeping them isolated from one another. The Fundamental Library GitHub Repository consist of:

Customer Experience Package Fundamental Library Next Package Common Css Styles Package

Thanks

<a href="https://www.chromatic.com/"><img src="https://user-images.githubusercontent.com/321738/84662277-e3db4f80-af1b-11ea-88f5-91d67a5e59f6.png" width="153" height="30" alt="Chromatic" /></a>

Thanks to Chromatic for providing the visual testing platform that helps us review UI changes and catch visual regressions.