Skip to content

Instantly share code, notes, and snippets.

@sainu
Created June 12, 2016 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sainu/5fd1460386ed54e63fb8352d1d1e6e3d to your computer and use it in GitHub Desktop.
Save sainu/5fd1460386ed54e63fb8352d1d1e6e3d to your computer and use it in GitHub Desktop.
SASS
// 全コアファイルのインポート用SCSSファイル
@import "core/setting";
@import "core/utility";
@import "core/utility-css3";
@import "core/style-mixin-reset";
@import "core/style-mixin-base";
@import "core/style-mixin-layout";
@import "core/style-mixin-module";
$column-width: 60px; // 12 columns = 720px
$gutter-width: 20px; // 11 gutters = 220px
// # Vendor-prefixed CSS Property
$use-prefix-webkit: true;
$use-prefix-moz : true;
$use-prefix-ms : true;
$use-prefix-o : true;
//サポートブラウザの設定
$support-ie6: false;
$support-ie7: true;
$support-ie8: true;
$support-ie9: true;
$support-mozilla: true;
$support-webkit : true;
$support-opera : true;
// # IE
$use-ie-filter : false;
$use-ie-expression: false;
// # Path
$path-pj : "*****";
$path-img: "#{$path-pj}/img";
$path-sprite: "#{$path-img}/sprite.png";
// DOCTYPEがHTML5の場合のみ、
// $use-html5をtrueにし、スタイルを出力する。
$use-html5: true;
// 基本スタイルの変数とMixinsを記述します。
@mixin base-common {
// ここにベースのスタイルを記述します。
body {
}
}
// レイアウト用スタイルの変数とMixinsを記述します。
@mixin layout-site-header {
}
@mixin layout-site-footer {
}
// モジュール用スタイルの変数とMixinsを記述します。
@mixin mod-pageTtl {
// ここにモジュールのスタイルを記述します。
.pageTtl {
}
}
// 記述するのは変数とMixins、関数などCSSに出力されないものだけです。
// 下記のように規則集合やCSSコメントは記述してはいけません。
/* @:topicPath */
.mod-topicPath {
:
}
// リセットスタイルの変数とMixinsを記述します。
@mixin reset-common {
// ここにリセットのスタイルを記述します。
html {
overflow-y: scroll;
}
@if $use-html5 {
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
}
}
// ベンダープリフィックスが必要なプロパティのMixinsを記述しています。
@mixin border-radius($property-value, $property-type: shorthand) {
// [NOTE]
// Firefox3.6以下のtopleftやbottomrightなどの
// 1コーナーのみを指定する記述には対応していません。
//
$property: border-radius;
@if $property-type != shorthand {
$property: border-#{$property-type}-radius;
// e.g. 'top-left', 'bottom-right'
}
// OUTPUT
@if $use-prefix-webkit { -webkit-#{$property}: #{$property-value}; }
@if $use-prefix-moz { -moz-#{$property}: #{$property-value}; }
#{$property}: #{$property-value};
}
// 画像置換やclearfixなどのスタイルセット用と、inline-blockやfont-familyといったプロパティ用のMixinsを記述しています。
// スタイルセット用のMixins
// # grid
// .container {
// @include grid-unit(12);
// }
// .main {
// @include grid-unit(8);
// }
// .side {
// @include grid-unit(4);
// }
@mixin grid-unit($span) {
float: left;
margin-right: $gutter-width;
width: ($column-width * $span) + ($gutter-width * ($span - 1));
}
@mixin clearfix {
@if $support-ie6 or $support-ie7 {
*zoom: 1;
}
&:after {
content: "";
display: block;
clear: both;
}
}
// プロパティ用のMixins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment