Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
close #12 and #13, close #14, close #16, close #18
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Aug 1, 2014
1 parent 19f044a commit 974905b
Show file tree
Hide file tree
Showing 10 changed files with 277 additions and 573 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

### 1.8.0 - 8/1/14
* Deprecated `$shift` modifier.
* Optimized `for` query to output comma delimited list of queries instead of duplicating styles for each query.
* Optimized `_main.scss`. Significantly cleaned up code by grouping like-calls together into the same conditional.
* Removed prefixes from all properties.
* Created `flint-box-sizing` mixin. Uses `box-sizing` mixin if it exists.
* Removed `only screen` from media queries.

### 1.7.2 - 7/14/14
* Removed `string-to-number` functions and all dependencies associated with them.

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Enjoy.
* [Wrapping in media queries](#wrapping-in-media-queries)
* [Call by alias](#call-by-alias)
* [Gutter modifiers](#gutter-modifiers)
* [Shift modifiers](#shift)
* [Shift modifiers](#shift) _[Deprecated]_
1. [Syntax support](#syntax-support)
1. [Authors](#authors)
1. [License](#license)
Expand Down Expand Up @@ -143,13 +143,15 @@ $flint: (

### Foundation

If you selected `"border-box-sizing": true`, then it is *advised* to create a global foundation instance like so,
_Flint will attempt to use a local box-sizing mixin named `box-sizing`. If one is not found, it will use it's own._

A foundation instance will output a global `box-sizing: border-box` declaration. If you selected `"border-box-sizing": true`, then it is *advised* to create a global foundation instance.

```scss
@include _(foundation);
```

That way your output won't be riddled with `box-sizing` declarations everytime you define a span. This will automatically output the rules onto the global selector `*`. In the future this might be automatic, but for now I'll keep it manual.
This way your output won't be riddled with `box-sizing` declarations every time you define a span. This will automatically output the rules onto the global selector `*`. In the future this might be automatic, but for now I'll keep it manual.

### Container

Expand All @@ -175,6 +177,8 @@ Outputs,

### Clear

_Flint will attempt to use a local clearfix mixin named `clearfix`. If one is not found, it will use it's own._

Given that Flint is float based, you might find yourself needing to use a clearfix. Flint comes packaged with a micro-clearfix function.

```scss
Expand Down Expand Up @@ -746,6 +750,8 @@ Outputs,

### Shift

_The `$shift` modifier has been deprecated as of `1.8.0`. It is set to be removed in version `2.0`._

Much like the gutter modifiers, you may also call in a shift parameter using the `$shift` variable. This will cause the element to shift the desired amount of columns using positive/negative left margins.

```scss
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flint",
"version": "1.7.2",
"version": "1.8.0",
"main": "stylesheets/_flint.scss",
"description": "Flint is designed to be a flexible layout toolkit that developers can use for any responsive grid-based project.",
"authors": ["Ezekiel Gabrielse <ezekg@yahoo.com>"],
Expand Down
4 changes: 2 additions & 2 deletions lib/flint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

# Date is in the form of YYYY-MM-DD
module Flint
VERSION = "1.7.2"
DATE = "2014-07-14"
VERSION = "1.8.0"
DATE = "2014-08-01"
end

# Custom functions
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/flint/globals/_globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $flint__support-syntax: if(flint-exists($flint, "support-syntax"), flint-get-val

// Use Ruby functions?
// ----
$flint__use-ruby-functions: if(flint-use-ruby-functions(), true, false) !global;
$flint__use-ruby-functions: if(flint-use-ruby-functions() == true, true, false) !global;

// Cached selector instance lists
// ----
Expand Down
1 change: 1 addition & 0 deletions stylesheets/flint/mixins/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Mixins
// ----
@import "lib/clearfix";
@import "lib/box-sizing";
@import "lib/new-instance";
@import "lib/print-instance";
@import "lib/calculate";
Expand Down
14 changes: 14 additions & 0 deletions stylesheets/flint/mixins/lib/_box-sizing.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Box sizing
// -------------------------------------------------------------------------------
// @param $type [string] : border-box type, defaults to "border-box"
// -------------------------------------------------------------------------------
// @uses : local box-sizing mixin if available
// -------------------------------------------------------------------------------

@mixin flint-box-sizing($type: "border-box") {
@if mixin-exists("box-sizing") {
@include box-sizing($type);
} @else {
box-sizing: #{$type};
}
}
33 changes: 26 additions & 7 deletions stylesheets/flint/mixins/lib/_calculate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
// -------------------------------------------------------------------------------
// @output calculated styles

@mixin flint-calculate($calc-key, $calc-span, $calc-context, $calc-gutter, $calc-shift, $i: null) {
@mixin flint-calculate($key, $span, $context, $gutter, $shift, $i: null) {

// Default values
// Define local vars
$calc-key: $key;
$calc-span: $span;
$calc-context: $context;
$calc-gutter: $gutter;
$calc-shift: $shift;

// Define default values
$output-width: 0;
$output-margin-right: 0;
$output-margin-left: 0;
Expand All @@ -38,27 +45,29 @@
$cached: false;

// Check if any arguments are lists if called from loop
// ----
@if $i != null {

@if length($calc-key) > 1 {
@if flint-types-in-list($calc-key, "number") {
$calc-key: nth($calc-key, $i);
}
@if length($calc-span) > 1 {
@if flint-types-in-list($calc-span, "number") {
$calc-span: nth($calc-span, $i);
}
@if length($calc-context) > 1 {
@if flint-types-in-list($calc-context, "number") {
$calc-context: nth($calc-context, $i);
}
@if length($calc-gutter) > 1 {
@if flint-types-in-list($calc-gutter, "string") {
$calc-gutter: nth($calc-gutter, $i);
}
@if length($calc-shift) > 1 {
@if flint-types-in-list($calc-shift, "number") {
$calc-shift: nth($calc-shift, $i);
}

}

// Check for cached results
// ----
@if $calc-context != "auto" and $calc-span != 0 {
@if map-has-key($flint__cache-results, "#{$calc-key, $calc-span, $calc-context, $calc-gutter, $calc-shift, $i}") {

Expand All @@ -81,6 +90,10 @@
@include _($calc-key) {
display: none;
}
// If we're hiding the default, but span is a list, define floats for other queries
@if flint-is-list($span) {
float: unquote(flint-get-value("settings", "float-style"));
}
} @else {
display: none;
}
Expand All @@ -90,6 +103,12 @@

} @else {

// Define floats if key is default, or this is a single instance call
// ----
@if flint-is-default($calc-key) or $i == null {
float: unquote(flint-get-value("settings", "float-style"));
}

// Only run through if cache search was unsuccessful
@if $cached == false {

Expand Down
24 changes: 15 additions & 9 deletions stylesheets/flint/mixins/lib/_clearfix.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
// -------------------------------------------------------------------------------
// @documentation http://nicolasgallagher.com/micro-clearfix-hack/
// -------------------------------------------------------------------------------
// @uses : local clearfix mixin if available
// -------------------------------------------------------------------------------

@mixin flint-clearfix {
zoom: 1;
@if mixin-exists("clearfix") {
@include clearfix;
} @else {
zoom: 1;

&:before, &:after {
content: "\0020";
display: block;
height: 0;
overflow: hidden;
}
&:before, &:after {
content: "\0020";
display: block;
height: 0;
overflow: hidden;
}

&:after {
clear: both;
&:after {
clear: both;
}
}
}

0 comments on commit 974905b

Please sign in to comment.