Code Monkey home page Code Monkey logo

webchallange_31's Introduction

WebChallange_31

PSD design converted to responsive website.

Page is available at: https://mamucha.github.io/WebChallange_31/

More information about the project:

BEM

BEM methodology has been used in this project.

Block - Standalone entity that is meaningful on its own

  nav, container, menu, checkbox

Element - Part of a block with no standalone meaning

  nav__item, list__item, checkbox__caption

Modifier - A variation of a block or element

  nav__item--active, checkbox--checked, nav--fixed, nav-dark

Types of modifiers are used:

  • Namespaces
    Namespaces are used to add more scalability and maintainability to the code and to make it more self documented. There are few prefixed terms in use.

Layouts

 l-header, l-section, l-wrapper

Component

  c-button, c-card, c-contact

Helper

  h-active, h-nav
  • a boolean flag
    Original block/element name + double dash + mod name
    .prefix-block--mod or .prefix=block__elem--mod
  • a key/value pair
    Original block/element name + double dash + mod key name + single underscore + mod value
    .prefix-block--key_value or .prefix-block__elem--key_value

For example:

  <nav class="l-section l-section--about">...</nav>
  <div class="c-menu__burger c-menu__burger--open">...</div>

CSS specificity

It is often recommended to keep specificity low, consistent and very little difference between the selectors in order to make the stylesheet maintainable. Use of BEM methodology in this project allowed to keep specificity low and avoid spikes. https://github.com/mamucha/WebChallange_31/blob/master/resources/css_specificity_graph.png

Media queries

Inspired by Dominique Briggs' solution

Example:
_block.scss

@mixin c-block\@screen_large {
    .c-block { styles }

_media-queries.scss

@media only screen and (min-width: 1042px) {
  @include c-block\@screen_large;

File structure

The Sass architecture in this project is a modification of solution introduced in Hugo Giraudel's Sass Guidelines:

-> https://sass-guidelin.es/#architecture

src/
|
|--js/
|   |--app.js                       # Compile js.file
|
|--scss/
    |-- abstracts/                  # Global Mixins, Variables and Fonts
    |   |-- _abstracts-dir.scss
    |
    |-- base/                       # Base styles, Typography, Reset
    |   |-- _base-dir.scss
    |
    |-- componets/                  # Blocks, Elements and Modifiers
    |   |-- _components-dir.scss/
    |
    |-- layouts/                    # Larger layout components and media-queries styles.
    |   |-- _layouts-dir.scss
    |
    |-- vendor/                      
    |   |-- _normalize.scss         # Normalize.css v8.0.1
    |
    |-- style.scss                  # Main Scss file compiles to style.css

Gulp

Gulp is a build system for automating tasks.

  • Minification (Compress/Uglyfy)
  • Minification (Compress/Uglyfy)
  • Compile Sass, LESS files for you
  • Combining multiple js/css files into single file respectively
  • Converting SVG icons to fonts
  • Live browser reload
  • CSS browser prefix can be automated for eg.

setting the working environment -> http://domanart.pl/gulp/

webchallange_31's People

Contributors

mamucha avatar

Watchers

 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.