Giter VIP home page Giter VIP logo

scss's Introduction

Zalando Fabric Scss

CircleCI Styleguide GitHub contributors

Motivation

At Zalando Retail Operations we are developing a lot of web applications from small to mid-complex. As we are developing them in different cross-functional teams we wanted to guarantee the same look and feel in all of our applications independent from people and their development background. For guaranteeing same UI across applications and development teams we are developing a component-based Styleguide which provides a SCSS library and (P)React based components which can be all used independently.

This repository contains our scss styles.

Core Concepts

Folder structure

Our SCSS styles are organized based on the atomic design pattern which allows us a much clearer description and separation of our styles. We also believe that for the development of components atomic design gives a much clearer separation.

Therefore we have a clear folder structure:

  • Atoms - styles to the basic building blocks of our design. Basically all HTML Tags such as form, label, button, icons.
  • Molecules - Molecules are groups of atoms combined together to create smallest compunds of our Design. Based on molecules further complex compositions can be created. Molecules can be dropdowns , tooltips or pagination elements.
  • Organisms - Organisms are combined from a group of molecules and form a complex, still distinct part of an interface, e.g. a navigation header with a logo, links and a search field.
  • doc - General documentation of our styleguide (in Markdown). They are later consumed by the styleguide and displayed in the associated styleguide web application.
  • utils- utility functions for our SCSS library like variables, grid settings or other helper mixins.

Linting

Different people are working on our SCSS library and to ensure a common syntax and coding style we are using the PostCSS library stylelint which lints our SCSS code against a set of rules. Currently, we are using an existing OSS ruleset.

You can lint your SCSS code

gulp lint-scss

It runs styleint with the SCSS ruleset and breaks for any given linting error.

Use the design/framework

You can install the package via

npm i -D git+https://github.com/fabric-design/scss.git

If you want to use the whole SCSS library you can just import the index SCSS file

@import "node_modules/fabric-scss/index"

Contributing

Our Zalando Retail Operations Styleguide is in active development and we welcome any contributions and feedback. See our CONTRIBUTING.md for detailed information on how to contribute.

LICENSE

The MIT License (MIT)

Copyright (c) 2017 Zalando SE

LICENSE

scss's People

Contributors

adriandampc avatar antnascimento avatar epaul avatar faboweb avatar fokusferit avatar fragsalat avatar janjongerden-zalando avatar jordi-rubio avatar mihachicken avatar mousemke avatar myueksel avatar schluchter avatar szafranek avatar tonysaad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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

scss's Issues

Review filterable dropdown component

Thomas Schlage implemented in Blockorder already a component that can filter multiple values for selection. Needs to be adapted to the latest Design System styles, and aligned with the filterable dropdown pattern.

[Bug] Webpack + Sass-Loader sourceMap support not possible

Basically the issue is related to libsass (sass/libsass#2312) which is used by node-sass (which is used by sass-loader in webpack).

During our prototyping we discovered two issues:

The error report for example is:

  throw new Error('Invalid mapping: ' + JSON.stringify({
      ^

Error: Invalid mapping: {"generated":{"line":1,"column":29588},"source":"webpack:///node_modules/wholesale-styleguide-scss/atoms/_buttons.scss","original":{"line":46,"column":-17},"name":null}
    at SourceMapGenerator_validateMapping [as _validateMapping] (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/source-map/lib/source-map-generator.js:277:13)
    at SourceMapGenerator_addMapping [as addMapping] (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/source-map/lib/source-map-generator.js:101:12)
    at /Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/source-map/lib/source-node.js:345:13
    at SourceNode_walk [as walk] (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/source-map/lib/source-node.js:224:9)
    at SourceNode_walk [as walk] (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/source-map/lib/source-node.js:220:13)
    at SourceNode_walk [as walk] (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/source-map/lib/source-node.js:220:13)
    at SourceNode_toStringWithSourceMap [as toStringWithSourceMap] (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/source-map/lib/source-node.js:336:8)
    at ConcatSource.proto.sourceAndMap (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack-sources/lib/SourceAndMapMixin.js:30:32)
    at /Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack/lib/SourceMapDevToolPlugin.js:66:35
    at Array.map (native)
    at /Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack/lib/SourceMapDevToolPlugin.js:53:85
    at Array.forEach (native)
    at Compilation.<anonymous> (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack/lib/SourceMapDevToolPlugin.js:52:12)
    at Compilation.applyPlugins1 (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/tapable/lib/Tapable.js:75:14)
    at self.applyPluginsAsync.err (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack/lib/Compilation.js:639:11)
    at next (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.compilation.plugin (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack/lib/ProgressPlugin.js:117:6)
    at next (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/tapable/lib/Tapable.js:140:14)
    at Compilation.compilation.plugin (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:230:5)
    at Compilation.applyPluginsAsyncSeries (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/tapable/lib/Tapable.js:142:13)
    at self.applyPluginsAsync.err (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/webpack/lib/Compilation.js:635:10)
    at next (/Users/fetopcu/Desktop/Projects/alpha/shopping-queen-frontend/app/node_modules/tapable/lib/Tapable.js:138:11)

it is related to using '&' in mixins heavily which is weird as it is a crucial part of Sass.

Internationalisition

@fokusferit @fragsalat @tonysaad and me decided to go with following approach for internationalisation:

Each component that uses localisable labels has a property lang that takes in a language identifier.
The language can be chosen in the WS-Header. There is an language-changed-event propagated by the WS-Header the dev can listen on.
The localised labels are stored in a json per component.
The currency- and date-format are affected by this language property.
The default is always german ('de').
Both currency- and date-format can be overwritten by the properties currency-format and date-format.

Precommit check for linting

We aligned on having precommit hooks for tests and linting in place until we have CI ready. In this repo there is no precommit hook in place.

Check Prettier as a better alternative for code consistency

  • Check Prettier as a better alternative for code consistency

It might be simpler to use Prettier, also one tool, for code formatting. This task is about exploring Prettier and if it could reduce complexity of maintaining different rules in different repositories.

New Fabric Version necessary

Problem
For the new Retail Portal, we will introduce shared components (header, sidenavbar) and independently from our approach, this leads to an issue with the current fabric scss library. As the header will load parts of fabric, and will be "a container" for the integrated application, initially we need scoped styling for each application + shared components.

This is currently not possible as some Atoms are styling directly DOM Tags instead of abstracting them to CSS-Classes. More Details regarding "Rules of Play" will be shared (internally).

As part of this one might start also thinking of introducing Accessibility features as part of new major release.

Task
Rewrite the following Atoms, so that they are not styling DOM Tags directly but based on Class names:

  • Atoms/Toggle -> Radio and Checkbox Styling
  • Atoms/Button.scss
  • Atoms/Forms.scss
  • Molecules/Tables.scss

Additionally, it would be quite helpful when we could have already a fabric.css production ready file created in the repo so we can easily use with a CDN (or use https://rawgit.com/ ).

Outcome
A new version of Fabric as this is definitely breaking applications and should be a major version bump.
This would allow existing applications to update to the newer version when they are ready. This would also mean that we need to discuss topics around bug fixes, as master would be referencing to this new v2 and v1 would exist in a separate branch.

Create arrow-tip for popovers as a mixin

There are several components that use an arrow tip to indicate that a floating element is "attached" to another control:

  • Date picker
  • Time picker
  • Week picker
  • Dropdown

All these components should use the same implementation, therefore I'd suggest a mixin that works well with the border styles we've introduced to heighten arrow tip contrast on white background.

Font Updates

Line hight of fonts in tables are 3rem (instead of 2rem).

Change variable name of "Value XXL" in to "Value XXXL".

Added a new label style with 3rem line hight.

All fonts with the color "Lynch" changed to "Fiord"

Page Header Links:focus color

As a User
I want to see the text of a button after clicking it
So i can know what i just clicked

the focus color of the links is [nearly?] the same as the Page Header background. It should not have a focus color

[Feature] Header styling independant from Component

For our use case, we don't want to have the Fabric WSHeader Component, as our application will be used by users outside of the company, therefore:

  • A future Login will be not our internal IAM, instead a separate one
  • Initially we don't need any language selector, login etc. -> Only a Header Bar.

I've started with the second one and will work on that topic, so that we have the scss from the Header component separated and as part of the scss library.

Publishing to npm

a) Publishing to internal npm is not complicated as CDP provides a solution for that.
b) We are still on GH and can do it with CircleCI and publish to official npm

Icon positioning is super-hacky

In every component that uses icons, implementers use different strategies to make them align the way they want to. Because of the way the icon CSS is structured, it's really hard to predict how icons are going to behave when they are placed at different sizes.

Let's clean that up.

Add Autoprefixer for IE11 Support

During our Innovation Camp, I discovered that we don't prefix anything, therefore usage of CSS Functions like transform3D are not applicable and might create a breaking UI.

Fix stylelint issues

  • Fix stylelint issues (2000+) (use stylefmt to autoformat as much as possible)
  • How can we 'force' people to use the stylelint linting rules ?

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.