Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
20eaf56
Finish 0.0.3
Mar 10, 2016
89de591
Finish 0.0.4
Mar 10, 2016
8e55ccc
Finish 0.0.5
Mar 10, 2016
e721478
Finish 0.0.6
Mar 11, 2016
c18c928
updated readme.md
sammularczyk Mar 11, 2016
9f8d8d1
why we made this
sammularczyk Mar 11, 2016
8e41c97
proof README
sawks Mar 11, 2016
bcd3cf9
link to demo
sawks Mar 11, 2016
8cbd555
Added bootstrap example ref
tbredin Mar 12, 2016
81aa4ab
Update README.md
tbredin Mar 12, 2016
16f3d51
Finish 1.0.0
Mar 14, 2016
a5edae0
Finish 1.0.1
Mar 15, 2016
c880928
Add licensing information
gvnn Mar 25, 2016
5c2c8ff
Update LICENSE. Added Thomas Bredin-Grey.
gvnn Mar 25, 2016
1344f24
Update LICENSE.txt
tbredin Mar 25, 2016
7f0d572
Merge pull request #9 from StudioThick/feature/license
gvnn Mar 28, 2016
2246a86
SPELL THE NAME OF THE PROJECT CORRECTLY
sawks Mar 29, 2016
0ed8253
Merge branch 'develop'
sawks Mar 29, 2016
5a8ab1b
Fix syntax error in @if conditional statement
zacwasielewski Mar 29, 2016
1705aff
Merge pull request #10 from zacwasielewski/hotfix/if-syntax-error
Mar 29, 2016
844ee34
Update LICENSE.txt
tbredin Mar 30, 2016
38da080
Update package.json for nom publishing
gvnn Apr 2, 2016
3a23b9d
Update readme with Npm instructions
gvnn Apr 2, 2016
e2126cc
Merge branch 'feature/npm' into develop
gvnn Apr 2, 2016
18f49ee
Update package.json version number
gvnn Apr 2, 2016
5d46c1e
Merge branch 'release/1.0.2'
gvnn Apr 2, 2016
3cc2352
Merge branch 'release/1.0.2' into develop
gvnn Apr 2, 2016
b00016e
Sync info in bower.json and package.json
gvnn Apr 2, 2016
a750271
Merge branch 'hotfix/packaging' into develop
gvnn Apr 2, 2016
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
10 changes: 10 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is the official list of Megatype authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.

# Names should be added to this file as:
# Name or Organization <email address>
# The email address is not required for organizations.

Studio Thick Pty Ltd
Thomas Bredin-Grey <tom@studiothick.com>
17 changes: 17 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This is the official list of people who can contribute
# (and typically have contributed) code to this repository.
# The AUTHORS file lists the copyright holders; this file
# lists people.
#
# Names should be added to this file like so:
# Name <email address>
#
# Please keep the list sorted.
# (first name; alphabetical order)

Abhishek Suresh <abi@studiothick.com>
Giovanni Ferron <giovanni@studiothick.com>
Matt Sawkill <matt@studiothick.com>
Nathan Thorpe <nathan@studiothick.com>
Sam Mularczyk <sam@studiothick.com>
Tom McLean <tom.mclean@studiothick.com>
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License

Copyright (c) 2016 The MegaType Project Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

90 changes: 54 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
![Megatype](http://studiothick.github.io/megatype/favicons/apple-touch-icon-144x144.png)
![MegaType](http://studiothick.github.io/megatype/favicons/apple-touch-icon-144x144.png)

# Megatype
Execute typographic structure with ease
# MegaType
Execute typographic structure with ease.

[The MegaType demo page](http://megatype.studiothick.com) shows how typesetting rules scale across breakpoints.

[![Build Status](https://travis-ci.org/StudioThick/megatype.svg?branch=master)](https://travis-ci.org/StudioThick/megatype)

##Install

Download manually or install with Bower (recommended):
```bower install megatype --save-dev```
Download manually or install with Bower (recommended):

bower install megatype --save-dev

or with Npm

npm install megatype --save-dev

You can add a load path to your build process of choice (gulp example shown):

You can add a load path to your build process of choice (gulp example shown):
```js
// gulpfile.babel.js

Expand All @@ -29,18 +37,19 @@ gulp.task('styles', () => {
});
```

And import into your styles with:
And import into your styles with:

```scss
@import "megatype";
```
```

##Using MegaType
MegaType provides typesetting tools, and some breakpoint mixins.

MegaType provides typesetting tools, and some breakpoint mixins.

###Config
Copy `_config.scss` into your code base and override the `!default` settings where required, leaving unmodified values commented out.
First, set up your breakpoint map (defaults shown) and your baseline snap & scaling preferences:
Copy `_config.scss` into your codebase and override the `!default` settings where required, leaving unmodified values commented out.
First, set up your breakpoint map (defaults shown) and your baseline snap & scaling preferences:

```scss
// config.scss

Expand Down Expand Up @@ -82,30 +91,31 @@ $breakpoint-map: (
);

```
Breaking down the map:
- `start` is the start position of the breakpoint. Can be `px` or `em`.
- `max` is the max width of the container. Can be `px`, `em`, or `%`.
- `rootsize` is the base font size applied to the `html` element. Can be `px` or `rem`. This also controls our grid size at this breakpoint.
These values can be retrieved using the `break-get` function, eg:
Breaking down the map:
- `start` is the start position of the breakpoint. Can be `px` or `em`.
- `max` is the max width of the container. Can be `px`, `em`, or `%`.
- `rootsize` is the base font size applied to the `html` element. Can be `px` or `rem`. This also controls our grid size at this breakpoint.
These values can be retrieved using the `break-get` function, eg:
```scss
.my-component {
width: break-get(3, max);
}
```

To intialise the baseline, call MegaType at the top of your stylesheet:
To intialise the baseline, call MegaType at the top of your stylesheet:
```scss
@include megatype;
```

For containers, you may also wish to to apply `max` widths from your config:
For containers, you may also wish to to apply `max` widths from your config:
```scss
.my-container {
@include set-container;
}
```

Next we need to provide some information about each font we want to typeset. Modify the ones provided, or add your own:

Next we need to provide some information about each font we want to typeset. Modify the ones provided, or add your own:

```scss
// Set cap height to set to the baseline.
// Here are some cap-height sizes to get you started:
Expand All @@ -131,14 +141,13 @@ $monospace: (
cap-height: 0.68
) !default;
```
To set the correct `cap-height` you will need to tweak this in the browser until your typefece sits nicely on the baseline.

**Tip:** Setting `$debug-allow` and `$debug-baseline` variables to `true` will display a visual representation of the baseline on your typeset elements.
To set the correct `cap-height`, you will need to tweak this value and check in your browser until your typeface sits nicely on the baseline.

**Tip:** Setting `$debug-allow` and `$debug-baseline` variables to `true` will display a visual representation of the baseline on your typeset elements.

###Setting type

With our rootsize initialised and our typographic config all set up, we can start setting type.
With our rootsize initialised and our typographic config all set up, we can start setting type.

First, provide the typeface variable, and then provide `$fontsize`, `$lineheight`, `$leader` and `$trailer` in `px`, `rem`, or baseline units. One baseline unit is equivalent to the `rootsize` for that media query.

Expand All @@ -160,8 +169,10 @@ p {
@include typeset($sans, 16px, 2rem, 0, 2);
}
```
The `$fontsize`, `$leader` and `$trailer` are output in `rem`, whereas the lineheight is output as a unitless number.
`$leader` is calculated alongside an offset to put our type on the baseline, and output as a `top` value. This is then added to the `$trailer`, which is output as `margin-bottom`.

The `$fontsize`, `$leader` and `$trailer` are output in `rem` units, whereas the lineheight is output as a unitless number.

`$leader` is calculated alongside an offset to put our type on the baseline, and output as a `top` value. This is then added to the `$trailer`, which is output as `margin-bottom`.


###Media queries
Expand All @@ -171,7 +182,7 @@ To set type at different breakpoints, our `typeset` mixin needs to know about th
```scss
p {
@include typeset($sans, 16px, 24px, $leader: 0, $trailer: 2);

// we can apply a single breakpoint, starting with breakpoint key: 1
@include min-width(1) {
@include typeset($sans, 16px, 24px, $leader: 0, $trailer: 2);
Expand All @@ -196,7 +207,7 @@ Both of these mixins can also accept `px` values for a custom media query shortc


###Debugging
MegaType contains extensive debugging tools to let you visualise your type and grid setup, which are on by default.
MegaType contains extensive debugging tools to let you visualise your type and grid setup, these are enabled by default.

```scss
// debug baseline grid
Expand All @@ -207,24 +218,31 @@ $debug-type: true;
$debug-breakpoints: true;
```

And these can be toggled on and off with one variable in `megatype.scss`:
Debugging can be toggled on and off globally with one variable in `megatype.scss`:

```
$debug-allow: true;
```

**Note:** Background gradients are used for some debugging elements. As background gradients suffer from pixel rounding issues, they may become out of sync with some configurations at long distances (on long typeset pages, for example). This is expected behaviour.
**Note:** Background gradients are used for some debugging elements. As background gradients suffer from pixel rounding issues, they may get out of sync on some configurations with extreme dimensions (on lengthy typeset pages, for example). This is an unfortunate, but expected behaviour.

###Why did we make this?
Web typography, as we see it, is broken. For a full explanation on why MegaType exists, [read our blog post!](http://www.studiothick.com/essays/web-typography-is-broken)

###Extras
A few extra goodies.

- See `_typography.scss` for some functions that can easily return information from your typeface configs.
- An optional color palette config is included, see `_config.scss` and `_map-helpers.scss` for
- The `typeset` mixin sets some background position for easily replacing ugly default text decoration with background gradients (can be disabled with `$link-underline-support` in `_config.scss`). See `_text-link.scss` for a self-explanitory helper `text-link` mixin.
- An optional color palette config is included, see `_config.scss` and `_map-helpers.scss` for
- The `typeset` mixin sets some background position for easily replacing ugly default text decoration with background gradients (can be disabled with `$link-underline-support` in `_config.scss`). See `_text-link.scss` for a self-explanatory helper `text-link` mixin.
- See `_toolset_easing.scss` for some handy functions to use in animation easing
- See `_toolset_units.scss` for some handy unit conversion tools

###Bootstrap example
Looking for an example bootstrap integration? We've set up [a basic example here](https://github.com/StudioThick/megatype-bootstrap), based on the [yeoman webapp generator](https://github.com/yeoman/generator-webapp).

## Roadmap
- Node packages
- Tests
- Default config templates?
- Megatype Susy 2 example
- More example tests
- Default config templates
- Example themes?
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "megatype",
"description": "Finesse typographic structure with legendary technique",
"version": "1.0.2",
"description": "Execute typographic structure with ease",
"main": "megatype.scss",
"authors": [
"tbredin <tom@studiothick.com>"
Expand Down
4 changes: 2 additions & 2 deletions megatype/_text-link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@mixin text-link($color: palette(blue), $hover: $color, $hover-opacity: 0.6) {
$transparency: 0.6;

@if ($color == white or $color = #fff or $color == #ffffff) {
@if ($color == white or $color == #fff or $color == #ffffff) {
$transparency: 0.25;
}

Expand Down Expand Up @@ -59,4 +59,4 @@
text-decoration: none !important;
}
}
}
}
31 changes: 26 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "megatype",
"version": "1.0.1",
"private": true,
"version": "1.0.2",
"private": false,
"description": "Finesse typographic structure with ease",
"main": "megatype.scss",
"scripts": {
"test": "gulp test"
},
"author": "",
"license": "ISC",
"author": "The MegaType Project Authors",
"license": "MIT",
"devDependencies": {
"autoprefixer": "^6.1.1",
"babel-cli": "^6.6.5",
Expand Down Expand Up @@ -44,5 +44,26 @@
"presets": [
"es2015"
]
}
},
"directories": {
"test": "test"
},
"dependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/StudioThick/megatype.git"
},
"keywords": [
"sass",
"susy",
"megatype",
"typography",
"baseline",
"vertical-rhythm",
"grid"
],
"bugs": {
"url": "https://github.com/StudioThick/megatype/issues"
},
"homepage": "https://github.com/StudioThick/megatype#readme"
}