Giter Club home page Giter Club logo

fundamental-styles's Introduction

Fundamental Library Styles

NPM Version CI Status NPM Downloads Slack REUSE status StorybookJS

Deploys by Netlify

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

  • 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.

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

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

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fundamental-styles's Issues

Bug: Input-group button overflow

Input-group button overflows when you click on it, seems to be on both active and focus.
Components affected by this issue:

  • Combobox Input
  • Date Picker
  • Input Group
  • Localization Editor
  • Multi Input
  • Search Input
  • Time Picker

button-overflow

Menu component: underlying HTML changes for a11y

Menu component: https://sap.github.io/fundamental/components/menu.html

Underlying HTML changes needed:
<ul> add role='menu
<li> add role='presentation
<a> add role='menuitem and tabIndex='-1'

https://www.w3.org/TR/wai-aria-practices-1.1/#menu

re - tabIndex: "When using roving tabindex to manage focus in a composite UI component, the element that is to be included in the tab sequence has tabindex of "0" and all other focusable elements contained in the composite have tabindex of "-1".

Datepicker padding not applied when using popper styles

The padding on the calendar inside the datepicker is not applied when using the popper.js styles.

This is due to the popover body not being a required class when using popper.js. The padding is applied to fd-popover__body, when it should be applied to fd-popover__popper in our case.

Redefine form groups

Tasks:

  1. Change all examples that have a group of radio buttons or checkboxes to have a wrapping <div> with the fd-form__group class
  2. Create new class fd-form__group--inline
  3. Remove fd-form__item--inline class
  4. Update examples of inline radios or checkboxes to use fd-form__group--inline on wrapping <div>

Breadcrumb negative bottom margin as a source of potential issues

Describe the bug
A clear and concise description of what the bug is.

Is this issue related to a specific component?
Breadcrumb

What version of the Fiori Fundamentals are you using?
1.4.2

What offering/product do you work on? Any pressing ship or release dates we should be aware of?
Kyma

What front-end framework are you implementing in, e.g., Angular, React, etc.?
Angular (but framework usage is not related to the issue)

To Reproduce
Breadcrumb links on Firefox were hardly clickable due to Fiori Fundamentals having following style applied:

.fd-breadcrumb {
margin-bottom: -12px;
}

Expected behavior
fd-breadcrumb class should have a bottom margin of 0px to avoid overlapping of components. This is how we have fixed the issue for our app, since we consider this as the most sensible way to fix the issue.

Screenshots
The following screenshot shows the actual issue:
Screen Shot 2019-06-05 at 2 19 47 PM

Desktop (please complete the following information):
Firefox evergreen.
Layout is identical represented on Chrome, but probably due to Chrome custom behaviour the issue is not reproducible for that browser.

Release notes not being published

Release notes should look like the following: https://github.com/SAP/fundamental-react/releases/tag/v0.5.3

Screen Shot 2019-06-07 at 8 36 14 AM

This is being created by github-assistant, using the Changelog and github API, which require standard-version >=4.4.0. Unfortunately, we've had to lock on 4.2.0.

When attempting to upgrade any higher than 4.2.0, we encounter errors in Travis environment. Depending on the version, we get different variations of the same error:
Command failed: git commit --no-verify CHANGELOG.md -m "chore(release): version 0.1.0-rc.3 build 64 [ci skip]"
Not only is that failing, but it's skipping bumping the version in package.json and package-lock.json.

This does not happen on the other fundamental-* repos, using the exact same scripts, travis environment, standard-version version, etc.

See:
https://travis-ci.com/SAP/fundamental-styles/builds/114492798
https://travis-ci.com/SAP/fundamental-styles/builds/114465152

I believe it's related to these issues in standard-version, but I'm not sure how else to debug this as everything works locally, just not in Travis:
conventional-changelog/standard-version#256
conventional-changelog/standard-version#231

I think the root of the problem might be the changes made in 4.3.0 related to the skip argument: https://github.com/conventional-changelog/standard-version/blob/master/CHANGELOG.md#430-2018-01-03

Docs: fix homepage responsiveness

Explore Components button is being hidden during page responsiveness

image

Fiori Version: 1.5.3

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://sap.github.io/fundamental/
  2. Begin to make screen smaller
  3. Notice how Explore Components button is hidden when medium in size.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Bug: Wrong aria-label and tooltips on components

Is this a bug, enhancement, or feature request?

Bug

Briefly describe your proposal.

  • Back button should be labeled as "Back" instead of "Previous".
    - Action bar
    - Calendar ("Previous month", "Next month")
    - Date picker ("Previous month", "Next month")

  • Description Yes/No is invalid. Instead, use "Delete" and "Cancel".
    - Model

  • If a user tabs to the objects, the user must know what element he has selected and how many other items are in the current group. (ie. "Option 1, item 1 of 4")
    - Combobox input
    - Contextual menu
    - Dropdown
    - Mega menu
    - Menu
    - Side navigation

  • The back button should receive appropriate tooltips.
    - Action bar
    - Calendar
    - Context menu
    - Date picker
    - Dropdown

Bug: is-disabled class

The is-disabled class does not render the disabled state for a <span>.

See the screenshot.

broken

Related issue: #68.

Bug: Dropdown expands when label is clicked

Is this a bug, enhancement, or feature request?

Bug

Briefly describe your proposal.

If the user clicks into the label (not the dropdown button), the item should only get focus and the dropdown should not expand.

Bug: input group hover and focus states

2019-06-07 11 51 42

Input group hover and focus states are not rendering correctly. Hover makes the top and bottom borders transparent and focus does not highlight the left border. I think this may be due to the button not inheriting the size of the input group.

Popover in action bar is not aligned with other buttons

Is this issue related to a specific component?

Action Bar

What version of the Fiori Fundamentals are you using?

v1.4.3

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

Kyma / CDS / ModelT

What front-end framework are you implementing in, e.g., Angular, React, etc.?

Angular

To Reproduce
Steps to reproduce the behavior:
Create an action bar that has action buttons and popover on the right. Buttons and popover are not vertically aligned.

Expected behavior
Buttons and popover are vertically aligned. .fd-popover {top: 0;} should help to resolve the issue.

Screenshots
Screen Shot 2019-06-11 at 3 44 53 PM

A11y: Do not remove focus outline

A lint rule to assure that outline changes do not creep into the code base can be enabled to ensure outline is not altered. It exists, but is currently commented out here

https://github.com/SAP/fundamental/blob/master/.stylelintrc.yml#L38

Before Accessibility (A11y) was taken seriously, it was considered stylish to remove CSS outlines which are natively used to communicate focus. This is now considered an anti-pattern, and should be avoided.

See:
https://a11yproject.com/posts/never-remove-css-outlines/

Attempts to remove outline from normalize.css and css.reset have been shot down again due to A11y concerns:

necolas/normalize.css#204
necolas/normalize.css#108

Repeated PRs to Bootstrap to remove outline for stylistic purposes are always shot down due to A11y concerns.

MultiInput Component: underlying HTML changes needed for a11y

MultiInput component: https://sap.github.io/fundamental/components/multi-input.html

<span role='button'> should be <button> element for the tokens:

    <div class="fd-multi-input-tags">
        <span class="fd-token" role="button">Apple</span>
        <span class="fd-token" role="button">Berry</span>
        <span class="fd-token" role="button">Banana</span>
    </div>

This will be solved by #1346, but the examples inside of MultiInput should be updated to reflect this.

Replace form sets with form fieldsets

Tasks:

  1. Create new class fd-form__fieldset and put <fieldset> element styling into its definition (removal of border, padding and margin)
  2. Remove fd-form__set class
  3. Remove extra top margin on form messages when inside of a form set (removing form set should already do this)
  4. Remove form sets from examples that use <div>
  5. Change form sets to form fieldsets on examples that use <fieldset>

fd-time has hardcoded width value

The fd-time component has a hardcoded width value which is a problem for the NGX and React implementation libraries (at least, not sure about Vue).

However, I can't seem to find a clean fix for the sass. What do you guys think? For the libs, it's sufficient to just remove the hardcoded width, but that breaks the display in the docs.

Example from fd-react:
image

Make close icon in token optional

This issue is about the token component as described here:

https://sap.github.io/fundamental/components/token.html

Not sure what the spec says to be honest but have you considered making the x in tokens optional? At the moment the x is added via CSS and not by using some other means that could be simply left out.

Related issue: #952

I am unable to access the content behind the link mentioned in #952 so this issue could very well be a duplicate.

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.