Code Monkey home page Code Monkey logo

ekzo's Introduction

Ekzo

Sass framework

Functional, Atomic, OOCSS-driven, layered, design-free, BEM-based, responsive and mighty


NPM version

How to use

Install framework with NPM:

npm install ekzo --save

Import parts you would like to use, like:

@import 'node_modules/ekzo/tools/index';

@import 'node_modules/ekzo/settings.defaults/assets';
@import 'node_modules/ekzo/settings.defaults/framework';
@import 'node_modules/ekzo/settings.defaults/misc';
@import 'node_modules/ekzo/settings.defaults/options';
@import 'node_modules/ekzo/settings.defaults/responsive';
@import 'node_modules/ekzo/settings.defaults/themes';
@import 'node_modules/ekzo/settings.defaults/typography';

@import 'node_modules/ekzo/base/normalize';

@import 'node_modules/ekzo/generic/shared';
@import 'node_modules/ekzo/generic/headings';
@import 'node_modules/ekzo/generic/text';

@import 'node_modules/ekzo/objects/grid';

@import 'node_modules/ekzo/helpers/flex';
@import 'node_modules/ekzo/helpers/spacing';
@import 'node_modules/ekzo/helpers/typography';
@import 'node_modules/ekzo/helpers/widths';

Imports should be layered in following order:

Refer to Kotsu style.scss as an example.

Requirements

Sass 3.4.2 or higher.

Autoprefixer is highly advised.

Browsers support

IE Edge Chrome Firefox Safari Opera Opera Mobile iOS Safari Android
10+ 12+ 21+ 28+ 6.1+ 12.1+ 12.1+ 7.1+ 4.4+

_ie.scss provides graceful regression for IE9 and below:

  • Grid, media and nav objects will fallback from flexbox to inline-block, table or float-based models.
  • Flexbox alignment helpers will fallback to text-align and vertical-align to imitate intended alignment on inline-block-based grid, media and nav objects.
  • ::placeholder and ::selection won't be styled nor displayed.

All this will help to maintain intended flow and alignment of elements as closely as possible, but some features will be limited, especially vertical alignment.

To use, include _ie.scss in stylesheet, which will be served only to IE9 and below with IE conditional comments.

Best used with

Kotsu โ€” Advanced Web Starter Kit & Static Website Generator with docker integration.

ekzo's People

Contributors

armordarks avatar mrhyde 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

Watchers

 avatar  avatar

ekzo's Issues

Update font()

Update $version behavior to handle random version

Merge breakpoints maps

  • Merge devices, custom and etc maps into single $ekzo-breakpoints
  • Improve mixin to work with such change

Make everything rem-based

  • rems to pxs function
  • font-size function
  • rem-generating mixin
  • rem-generating mixin even for margins and other properties
  • added new parameter for rems into ekzo-font-size() mixin

We need here more complex mixins, because all fallbacks for IE8 should be generated automatically.

Rems will allow to change whole website font-size and margins/paddings for specific screen just by changing root font-size in media query

Custom media queries

Add ability to use custom media queries.

Probably it should be predefined map breakpoints--custom and parameter in mixin, which will accept bool to trigger that map, or variable to trigger another map

Font maps

Store fonts in map and loop through it to output shorthand helper-classes and font-faces for each

$fonts: (
    'Open Sans': (
        file:  ... (optional);
        version: ... (optional);
        ...
    ),
    ...
) !default;

Better `ekzo-bg`

Replace

// ---------------------------------------
// Background
// ---------------------------------------

$ekzo-bg: $ekzo-bg-color;

with maps, or separate variables.

They should handle such parameters:

$ekzo-bg: url('#{$ekzo-images-path}/bg--hero.jpg') fixed center 290px $ekzo-bg-color;

Floated grids

Add option to use floated grids, like .floated-grid

Remove shorthand properties

Replace shorthand properties like margin, padding with separated ones to make overriding of single property easier

Per media-query font-size adjustement

Since initial idea with rems didn't worked out #40, we have to consider some better options.

So far:

  1. Do everything manually
  2. Enhance current $ekzo-font-sizes map to carry information about font-sizes for specific elements for specific breakpoints.
$ekzo-font-sizes: (
  text: (
    base: (
      phone: 14px,
      phone-ls: 14px,
      tablet: 16px,
      tablet-ls: 16px,
      lap: 16px,
      desk: 16px,
    ),
    '--': (
      phone: 12px,
      phone-ls: 12px,
      tablet: 14px,
      tablet-ls: 14px,
      lap: 14px,
      desk: 14px,
    ),
    '-': (
      phone: 11px,
      phone-ls: 11px,
      tablet: 12px,
      tablet-ls: 12px,
      lap: 12px,
      desk: 12px,
    )
  )
) !default;

but this looks like... too much...

Better aligment

Snippet from http://www.sitepoint.com/centering-with-sass/

/**
 * Enable position context for the child
 */
.parent {
  position: relative;
}

/**
 * Absolutely center the element in its parent
 * No dimensions are passed to the mixin, so it relies on CSS transforms
 */
.child-with-unknown-dimensions {
  @include center;
}

/**
 * Absolutely center the element in its parent
 * Width is passed to the mixin, so we rely on a negative margin for the
 * horizontal axis and CSS transforms for the vertical axis
 */
.child-with-known-width {
  @include center(400px);
}

/**
 * Absolutely center the element in its parent
 * Height is passed to the mixin, so we rely on a negative margin for the
 * vertical axis and CSS transforms for the horizontal axis
 */
.child-with-known-height {
  @include center($height: 400px);
}

/**
 * Absolutely center the element in its parent
 * Width is passed to the mixin, so we rely on a negative margins for both
 * horizontal axis and vertical axis
 */
.child-with-known-dimensions {
  @include center(400px, 400px);
}
@mixin center($width: null, $height: null) {
  position: absolute;
  top: 50%;
  left: 50%;

  @if not $width and not $height {
    transform: translate(-50%, -50%);
  } @else if $width and $height {
    width: $width;
    height: $height;
    margin: -($width / 2) #{0 0} -($height / 2);
  } @else if not $height {
    width: $width;
    margin-left: -($width / 2);
    transform: translateY(-50%);
  } @else {
    height: $height;
    margin-top: -($height / 2);
    transform: translateX(-50%);
  }
}

Add scoped font sizes

Yet to be decided do we really need it.

We could allow to define specific for certain scopes font sizes, which will generated all needed sets of helpers classes.

Like that:

$ekzo-font-sizes: (

  text: (
    base: 14px, // used for vertical rhythm calculation; = .text--base, .font-size--base, .line-height--base
    '-':  12px, // = .text-,  .font-size-,  .line-height-
    '--': 10px, // = .text--, .font-size--, .line-height--
  ),

  headings: (
    h1: 36px, // = h1, .h1, .font-size--h1, .line-height--h1
    h2: 30px, // = h2, .h2, .font-size--h2, .line-height--h2
    h3: 24px, // = h3, .h3, .font-size--h3, .line-height--h3
    h4: 21px, // = h4, .h4, .font-size--h4, .line-height--h4
    h5: 18px, // = h5, .h5, .font-size--h5, .line-height--h5
    h6: 16px, // = h6, .h6, .font-size--h6, .line-height--h6
  ),

  extra-headings: (
    \+\+: 96px, // = .extra-h\+\+\+, .font-size\+\+\+, .line-height\+\+\+
    \+:   72px, // = .extra-h\+\+,   .font-size\+\+,   .line-height\+\+
    base:   44px, // = .extra-h\+,     .font-size\+,     .line-height\+
  ),

  buttons: (), // = .btn--*name*

  // --------> here magic happens
  blog: (
    text: 20px,
    headings: ()
  )
  // --------> here magic ends

) !default;

Color maps

Think about color maps and loops to output .text--{color}

Update buttons

  • Add breakpoints-controlled sizes modifiers
  • Add ability to define default btn hovers
  • Add --border variant

Update tooltip

  • Improve code;
  • Replace repetitive parts with functions

Wrong default value position in docs

// @param {string=$font} $file-name        - should be specified in case of different
//                                           font file name from font name

should be

// @param {string} $file-name=$font        - should be specified in case of different
//                                           font file name from font name

Better docs

Update documentation of objecs, mixins, functions, helpers etc.

`for each breakpoint` mixin

Merge constructions like

@if $ekzo-enable-responsive-widths {

    @each $breakpoint, $value in $ekzo-breakpoints {
        @include ekzo-breakpoint($breakpoint) {
            @include ekzo-widths('#{$breakpoint}-');
        }
    }

} // endif

into single each-breakpoint() mixin

Improve breakpoints

  • Merge all groups (breakpoints, types, etc.)
  • Instead let each breakpoint have settings about should responsive helpers and objects be generated for it or no
  • Let select which exactly helpers and object should generate responsive classes for that breakpoint (probably, via list)

Something like:

$ekzo-breakpoints: (
  palm: (
    rule: 'screen and (max-width: #{$ekzo-lap - 1px})',
    generate-responsive: (buttons, grid, spacing, tables, widths)
  ),
  lap: (
    rule: 'screen and (min-width: #{$ekzo-lap}) and (max-width: #{$ekzo-desk - 1px})',
    generate-responsive: ('*')
  ),
  retina: (
    rule: 'screen and (-webkit-min-device-pixel-ratio: 2), screen and (min-resolution: 192dpi)',
    generate-responsive: false
  ),
  vetina: (
    rule: 'screen and (-webkit-min-device-pixel-ratio: 2), screen and (min-resolution: 192dpi)'
  )
) !default;

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.