Giter VIP home page Giter VIP logo

fundamental-styles's Introduction

Fundamental Library Styles

npm version Build Status npm Slack REUSE status

Deploys by Netlify

What is Fundamental Library Styles?

Fundamental Library Styles is a light-weight presentation layer that can be used with developers' UI framework of choice (e.g.Angular, React, Vue, etc.). Developers can build consistent Fiori apps in any web-based technology, by combining Fundamental Styles, library of stylesheets and HTML tags.

Learn more at http://sap.github.io/fundamental-styles/

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_fiori_3, sap_fiori_3_dark, sap_fiori_3_hcb, sap_fiori_3_hcw, 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:

@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/baseTheme/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/baseTheme/fonts/SAP-icons-TNT.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

html {
    font-size: 16px;
}

If you are not supporting IE11, the recommended format is woff2. If supporting IE11, use woff.

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:

  • Git (for downloading this repo)
  • Node LTS

SLA

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

SLA - What

  • Consumable CSS that strives for Fiori compliance.
  • Reference HTML specification that consuming libraries MUST adhere to.

SLA - How

  • Theme-able components built on top of SAP Theming Base Content by consuming the CSS Custom Properties delivered by the theming library
  • Self-contained styles. That is, each component's style file contains all the styling needed to be rendered properly. External styling won't bleed-in internal styling won't bleed-out. Bleeding in means that CSS global reset won't affect the component and bleeding out means that the component styling should not affect other HTML elements)
  • Accessibility support
    • Accessibility - Color contrast support for WCAG 2.0 level AA (4.5:1 for typical text)
    • Accessibility - Semantic HTML reference
    • Accessibility - Aria attributes noted when possible in HTML reference

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 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:

  • Dropping existing classnames, CSS variables, color names, color groups, spacing parameters
  • The existing underlying HTML markup of a component is altered
  • Non-visual HTML attribute changes/additions (such as role, aria-*, data-*)

    Note: Fundamental Styles provides CSS directly, and HTML as reference to consumers. Because of the reference relationship of the HTML seen in Fundamental Styles, we want to be very clear when we alter that reference so that it is properly reflected in JS implementation libraries. Because of this, even non-visual changes will be treated as breaking.

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

  • Introducing new classnames, CSS variables, color names, color groups, spacing parameters
  • Adding or modifying CSS properties and values of existing classnames.

Thanks

Chromatic

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

fundamental-styles's People

Contributors

fundamental-bot avatar droshev avatar innaatanasova avatar eboyer avatar xak avatar dependabot[bot] avatar jbadan avatar jkmarkowski avatar dependabot-preview[bot] avatar platon-rov avatar mikerodonnell89 avatar ckoutsiaris avatar salarenko avatar ianquigley-sap avatar g-cheishvili avatar stefanoscalzo avatar joseegm avatar jessmetivier avatar n1xus avatar rengare avatar greg-a-smith avatar betrozov avatar prsdthkr avatar saishan avatar deepaksap14 avatar jysw380 avatar lokanathan-k avatar dorinr avatar ritarora avatar ynnenu 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.