Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compass aliases #21

Merged
merged 5 commits into from
Oct 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Thumbs.db
.DS_Store
.DS_Store
node_modules
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
The only dependency is SASS. We also provide an <a href="https://www.npmjs.com/package/ritmo">npm</a> package.

Find all the documentation at [ritmo.marzeelabs.org](http://ritmo.marzeelabs.org).

===

##### Compass Aliases

If you would like to use the original [Compass naming conventions](http://compass-style.org/reference/compass/typography/vertical_rhythm/) with RITMO, simply add the following line to your main stylesheet after importing RITMO.

`@import '~ritmo/compass-aliases';`
31 changes: 31 additions & 0 deletions _compass-aliases.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Aliases Ritmo namespaced variables, functions, and mixins back to the original names from the Compass Veritcial Rhythm toolkit. Including this partial makes it possible to use Ritmo as a nearly plug and play replacement. You will still need to define the newer Ritmo configurable variables for $base-line-unit and $base-line-multi in place of $base-line-height.

// ALIASED VARIABLES

$ritmo-unit: $rhythm-unit !default;
$ritmo-border-width: $default-rhythm-border-width !default;

// ALIASED FUNCTIONS

@function rhythm($args...) { @return ritmo($args...); }

// ALIASED MIXINS

@mixin establish-baseline($args...) { @include ritmo-baseline($args...); }
@mixin adjust-font-size-to($args...) { @include ritmo-font-size($args...); }
@mixin adjust-leading-to($args...) { @include ritmo-leading($args...); }
@mixin leader($args...) { @include ritmo-top($args...); }
@mixin padding-leader($args...) { @include ritmo-top-padding($args...); }
@mixin margin-leader($args...) { @include ritmo-top-margin($args...); }
@mixin trailer($args...) { @include ritmo-bottom($args...); }
@mixin padding-trailer($args...) { @include ritmo-bottom-padding($args...); }
@mixin margin-trailer($args...) { @include ritmo-bottom-margin($args...); }
@mixin rhythm($args...) { @include ritmo($args...); }
@mixin rhythm-margins($args...) { @include ritmo-margins($args...); }
@mixin rhythm-padding($args...) { @include ritmo-padding($args...); }
@mixin apply-side-rhythm-border($args...) { @include ritmo-side-border($args...); }
@mixin leading-border($args...) { @include ritmo-top-border($args...); }
@mixin trailing-border($args...) { @include ritmo-bottom-border($args...); }
@mixin horizontal-borders($args...) { @include ritmo-horizontal-borders($args...); }
@mixin h-borders($args...) { @include ritmo-horizontal-borders($args...); }
@mixin rhythm-borders($args...) { @include ritmo-horizontal-borders($args...); }
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
},
"devDependencies": {
"node-sass": "^3.7.0"
}
},
"main": "_ritmo.scss"
}