@charset "UTF-8"; /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ /* カラー設定 */ /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ /* カラー定義 初期値は default のみだが、 任意の文字列をキーとして使って色を定義すれば、 サイト内で複数のカラー定義を持てる ------------------------------------ */ // 背景等の基調カラー $base-color-map: ( default: rgb(81,72,63) ); // ロゴ等の基本カラー $main-color-map: ( default: rgb(160,155,215) ); $main-color-deep-map: ( default: rgb(120,115,195) ); // アクセントカラー $accent-color-map: ( default: #ee3 ); /* 引数でキーを指定して 上記のマップで定義したカラーを返すfunction $contents-type: "second-color"; のように $contents-type のキー値を変えておけば getBaseColor($contents-type); を使用した際に、別カラーをセットできる仕組み $base-color-map: ( default: rgb(81,72,63) second-color: rgb(81,72,63) ); ------------------------------------ */ @function getBaseColor($key: default) { @return map-get($base-color-map, $key); } @function getMainColor($key: default) { @return map-get($main-color-map, $key); } @function getMainColorDeep($key: default) { @return map-get($main-color-deep-map, $key); } @function getAccentColor($key: default) { @return map-get($accent-color-map, $key); } /* カラー定義 ------------------------------------ */ $text-color: #fff; $base-color: getBaseColor($contents-type); $main-color: getMainColor($contents-type); $main-color-deep: getMainColorDeep($contents-type); $accent-color: getAccentColor($contents-type); /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ /* プロパティ */ /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ //ページ幅 $page-width-max: 1200px; //主要コンテンツの最大幅 $page-width-min: 350px; //主要コンテンツの最小幅 //一般的な画像のアスペクト比 $aspect-ratio: 2 / 3; //ウインドウ内部の左右余白 $pc-padding: 5rem; $sp-padding: 1.5rem; //フォントサイズを定義 (文字サイズ可変にするためremにはしない) $font-size-xl: 175.0%; //2.8rem $font-size-ll: 150.0%; //2.4rem $font-size-l: 125.0%; //2.0rem $font-size-m: 112.5%; //1.8rem $font-size-d: 100.0%; //1.6rem $font-size-s: 87.5%; //1.4rem $font-size-ss: 75.0%; //1.2rem $font-size-xs: 62.5%; //1.0rem //ブレイクポイントを定義 $breakpoint-s: 400px !default; $breakpoint-m: 768px !default; // startup.js の breakpoint_m_value と同じ値で設定する $breakpoint-l: 1200px !default; /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ /* 継承用(試作) */ /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ /* 仮)疑似要素 ::before, ::after で要素付加するときに書きがちな処理 ------------------------------------ */ %_pseudo_element{ content: ""; position: absolute; display: inline-flex; background-size: contain; background-position: 50% 50%; background-repeat: no-repeat; } /* 画像の伸縮表示 img要素に対して適用する。imgの幅と高さも定義すること 上記「アスペクト比を保った表示ボックス」と併用推奨 ------------------------------------ */ // エリア内に収めるように表示 ._img_contain, %_img_contain { object-fit: contain!important; } // エリア内をカバーするように表示 ._img_cover, %_img_cover { object-fit: cover!important; } /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ /* mixin 定義 */ /* ++++++++++++++++++++++++++++++++++++++++++++++++ */ /* アスペクト比を保った表示ボックス ※ 旧ブラウザを無視するなら aspect-ratio: ●/●; で済むが 非対応ブラウザにも適用したい場合の処理 ・横幅は基本100%で扱う。100%幅以外にしたい場合はこの要素よりも親要素で適用させる 想定しているHTML構造