Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Drupal Zen テーマ 7.x-6.x について
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
GOTO Hayato
December 16, 2016
Technology
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Drupal Zen テーマ 7.x-6.x について
Drupal 7 の定番ベーステーマのひとつ Zen のバージョン 7.x-6.x についてポイントをかいつまんでご説明します。
GOTO Hayato
December 16, 2016
More Decks by GOTO Hayato
See All by GOTO Hayato
Drupal のコア / モジュールへのコントリビュート方法について
gh640
0
660
Other Decks in Technology
See All in Technology
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
130
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
110
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
170
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
1
580
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
290
Refining Active Record
shugo
0
160
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
330
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
190
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
Designing for Timeless Needs
cassininazir
1
530
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
ラッコキーワード サービス紹介資料
rakko
1
5.3M
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
A Soul's Torment
seathinner
8
3.8k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
500
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
sira's awesome portfolio website redesign presentation
elsirapls
0
460
Transcript
Drupal Zen ςʔϚ 7.x-6.x ʹ͍ͭͯ
ࣗݾհ
ޙ౻Ͱ͢ • Drupal ΤϯδχΞ • ࣎լ
Zen 7.x-6.x
Zen
Zen Drupal ͷίϯτϦϏϡʔτςʔϚ • ͬͱਓؾͷߴ͍ςʔϚͷͻͱͭͰ͢ • ϕʔεςʔϚઐ༻ͷςʔϚͰ͢ • ֤छศརػೳ͕͍͍ͭͯ·͢
Zen 7.x-6.x
Zen 7.x-6.x 2016 य़ࠒʹϦϦʔε͞Ε·ͨ͠ • 7.x-5.x ͔Βେ෯ʹػೳՃ • 7.x-5.x ͷػೳͦͷ··
• SASS • Zen Grids • Drush ʹΑΔαϒςʔϚͻͳ͕ͨੜ
Zen 7.x-5.x
Zen 7.x-5.x • SASS: ͓ͳ͡ΈͷΞϨͰ͢ʢ Ruby ϕʔεʣ • Zen Grids:
ʢޙड़͠·͢ʣ • Drush ʹΑΔαϒςʔϚͻͳ͕ͨੜ: $ drush en zen # Zen ͷμϯϩʔυ & ༗ޮԽ $ drush cc all # ΩϟογϡΫϦΞ $ drush zen my_subtheme # => Zen ͷαϒςʔϚͷੜ
Zen 7.x-6.x
Zen 7.x-6.x ͜Μͳมߋ͕͋Γ·͢ • ϑΝΠϧׂ - SMACSS • ελΠϧΨΠυ -
KSS • λεΫϥϯφʔ - Gulp • ϥΠϒϥϦ - SASS • Ϋϥε໋໊ϧʔϧ - MindBEMding
Zen 7.x-6.x gulpfile.js ͷத
Zen 7.x-6.x gulpfile.js ͷத • autoprefixer • styleGuide • eslint
• BrowserSync • kss
Zen 7.x-6.x SASS ϑΝΠϧߏ
$ drush dl zen-7.x
Zen 7.x-6.x શϑΝΠϧ
Zen 7.x-6.x SASS ϑΝΠϧߏ sass: - styles.scss - _init.scss -
init/ - _colors.scss - _variables.scss - base/ - layouts/ - components/ - navigation/ - forms/
Zen 7.x-6.x SASS ϑΝΠϧߏ sass: - styles.scss (1) - _init.scss
(2) - init/ (2) - _colors.scss (2) - _variables.scss (2) - base/ (3) - layouts/ (4) - components/ (5) - navigation/ (6) - forms/ (7)
Zen 7.x-6.x SASS ϑΝΠϧߏ styles.scss (1): • ͦͷଞͷϑΝΠϧΛಡΈࠐΜͰશମΛ·ͱΊΔ
Zen 7.x-6.x SASS ϑΝΠϧߏ _init.scss (2): init/ (2): • ॳظԽॲཧΛߦ͏
• ֤छϥΠϒϥϦΛಡΈࠐΉ • Breakpoint / chroma / support-for / typey / zen-grids
Zen 7.x-6.x SASS ϑΝΠϧߏ • Breakpoint: ϒϨʔΫϙΠϯτʢϝσΟΞΫΤϦʣ • chroma: ৭
• support-for: ରϒϥβ • typey: ϑΥϯτ • zen-grids: ϨΠΞτ
ϥΠϒϥϦ
ϥΠϒϥϦ: Breakpoint ϝσΟΞΫΤϦʢϒϨʔΫϙΠϯτʣཧ༻ͷϥΠϒϥϦ https://github.com/at-import/breakpoint • ਓ͕ؒಡΈ͍͢ϝσΟΞΫΤϦ
ϥΠϒϥϦ: Breakpoint $pc: 960px; $tablet: 456px 794px; #foo { content:
'No Media Queries'; // Λ 1 ͭ͢ͱ min-width ʹͳΔ @include breakpoint($pc) { content: 'Basic Media Query'; } // Λ 2 ͭ͢ͱ min-width ͱ max-width ʹͳΔ @include breakpoint($tablet) { content: 'Paired Media Query'; } }
ϥΠϒϥϦ: Chroma ৭ใཧͷͨΊͷϥΠϒϥϦ http://johnalbin.github.io/chroma • ΧϥʔηοτʢʮεΩʔϜʯʣͷఆٛ • εΩʔϜͷܧঝ
ϥΠϒϥϦ: Chroma ఆٛ: ϕʔεεΩʔϜ @import "chroma"; // σϑΥϧτͷΧϥʔεΩʔϜΛఆٛ $chroma: define-default-color-scheme('ϒϥϯυΧϥʔΛఆٛɻ');
// σϑΥϧτΧϥʔεΩʔϜʹ৭ΛՃ $chroma: add-colors(( black: #000, red: #c00, // "blue" ͷΛ࣋ͭϋΠϥΠτΧϥʔΛఆٛ // ϝϞ: Ҿ༻ූͳ͠Ͱ blue ͕ࢦఆ͞Εͨ߹มͷࢀরͰͳ͘௨ৗͷ৭ͱղऍ͞ΕΔ primary: 'blue', ));
ϥΠϒϥϦ: Chroma ఆٛ: ࢠεΩʔϜ // ʮϑΝϯΫγϣφϧʯͳΧϥʔεΩʔϜΛ࡞ // σϑΥϧτΧϥʔεΩʔϜΛܧঝ͢Δ $chroma: define-color-scheme('functional',
'࣮ࡍʹར༻͢ΔΧϥʔεΩʔϜΛఆٛɻ'); // ϑΝϯΫγϣφϧΧϥʔεΩʔϜʹ৭ΛՃ $chroma: add-colors('functional', ( // text ͷΧϥʔΛσϑΥϧτΧϥʔεΩʔϜͰఆٛ͞Εͨ black ͷ৭ʹ͢Δ text: 'black', // ଞͷ৭ͷ໊લҾ༻ූ͋ΓͰͳ͠ͰͲͪΒͰ OK // ϝϞ: Ҿ༻ූΛ͚ͭͳ͚Ε৭ͷΩʔϫʔυจࣈྻͱͯ͠ೝࣝ͞Εͳ͍ heading: text, // ϦϯΫ৭ΛϓϥΠϚϦʔΧϥʔʹ͢Δ link: primary, // ϦϯΫϑΥʔΧεΧϥʔΛ lighten(link, 20%) Ͱઃఆ͢Δ link-focus: (link lighten 20%), ));
ϥΠϒϥϦ: Chroma ఆٛ: ଙεΩʔϜ // "alternate" ΧϥʔεΩʔϜΛ࡞ // functional ͔Βܧঝ
$chroma: define-color-scheme('alternate', 'ସΧϥʔεΩʔϜΛఆٛɻ', $parent: 'functional'); // alternate ΧϥʔεΩʔϜʹ৭ΛՃ $chroma: add-colors('alternate', ( primary: 'red', ));
ϥΠϒϥϦ: Chroma ར༻: // color() ͕ؔݺΕͨͱ͖ʹͲͷΧϥʔΛσϑΥϧτͰ༻͢Δ͔Ληοτ͢Δ $chroma-active-scheme: 'functional'; .example-ruleset {
h1 { // #000 color: color(heading); } a { // #0e71b8 color: color(link); .alternate-color-section & { // #c00 ʢͷ৭ʹϑΥʔϧόοΫʣ color: color(alternate, link); } } }
ϥΠϒϥϦ: support-for ϒϥβαϙʔτཧͷͨΊͷϥΠϒϥϦ https://github.com/JohnAlbin/support-for
ϥΠϒϥϦ: support-for ઃఆ: $support-for: ( // ϚΠφε࠷৽ͷόʔδϣϯ͔Βͷόʔδϣϯ chrome: -4, edge:
25, firefox: 45, ie: 9, opera: -4, safari: -4, '*': -4, ) !default; $support-for: ( safari: 8, // null αϙʔτͳ͠Λҙຯ͢Δ // ࢦఆ͞Ε͍ͯͳ͍ϒϥβͷσϑΥϧτ '*': null, );
ϥΠϒϥϦ: support-for ར༻: @mixin my-sweet-sweet-mixin($cocoa: lots) { border-radius: 100%; //
͜͜ IE 10 αϙʔτͷͨΊʹಡΈࠐ·ΕΔ @if support-for(ie, 10) { // IE 8/9/10 Ͱ a ͷ a ཁૉͷϘʔμʔΛআ͢Δ border: 0; } }
ϥΠϒϥϦ: typey ϑΥϯτؔ࿈ͷใΛཧ͢ΔͨΊͷϥΠϒϥϦ https://github.com/jptaranto/typey • ϑΥϯτઃܭͷར༻
ϥΠϒϥϦ: typey ઃఆ: ϑΥϯταΠζ $base-font-size: 15px; $font-size: ( xxl: 32px,
xl: 24px, l: 18px, m: $base-font-size, s: 12px, xs: 10px );
ϥΠϒϥϦ: typey ར༻: ϑΥϯταΠζ abbr { @include font-size(s); }
ϥΠϒϥϦ: typey ઃఆ: ϑΥϯτϑΝϛϦʔ $typefaces: ( sans-serif: ( font-family: $helvetica,
letter-spacing: -.5px, ), serif: $garamond, monospace: ( font-family: $monaco, letter-spacing: .5px, weight: bold, case: uppercase, ) );
ϥΠϒϥϦ: typey ར༻: ϑΥϯτϑΝϛϦʔ h1, h2, h3 { @include typeface(body);
}
ϥΠϒϥϦ: typey ઃఆ: ϑΥϯτपΓશൠ $typestyles: ( heading-1: ( font-size: xl,
line-height: 1.25, weight: bold, case: uppercase ), heading-2: ( font-size: l, line-height: 1.25, weight: normal ) )
ϥΠϒϥϦ: typey ར༻: ϑΥϯτपΓશൠ h1 { @include typeset(heading-1); }
ϥΠϒϥϦ: typey ઃఆ: Φϓγϣϯ $base-unit: 'rem';
ϥΠϒϥϦ: Zen Grids άϦουϨΠΞτͷͨΊͷϥΠϒϥϦ http://zengrids.com • άϦουϨΠΞτΛ͓खܰʹ࣮ݱ
ϥΠϒϥϦ: Zen Grids ઃఆ: import "zen-grids"; // ΧϥϜ $zen-columns: 7;
// ΨλʔαΠζ: ֤ΧϥϜͷ྆αΠυʹΨλʔͷͷۭന͕ೖΔ $zen-gutters: 10px;
ϥΠϒϥϦ: Zen Grids ར༻: HTML <div class="container"> <article class="content"> Tha
main content. We like semantic HTML ordering. </article> <aside class="aside1"> An aside. </aside> <aside class="aside2"> Another aside. </aside> <footer class="footer1"> A footer. </footer> <footer class="footer2"> Another footer. </footer> </div>
ϥΠϒϥϦ: Zen Grids ར༻: SCSS .container { // άϦουίϯςφ @include
zen-grid-container(); } .aside1 { // ෯͕ 2 ΧϥϜɺελʔτ͕ 1 ΧϥϜ @include zen-grid-item(2, 1); } .content { // ෯͕ 4 ΧϥϜɺελʔτ͕ 3 ΧϥϜ @include zen-grid-item(4, 3); } .aside2 { // ෯͕ 1 ΧϥϜɺελʔτ͕ 7 ΧϥϜ @include zen-grid-item(1, 7); }
ϥΠϒϥϦ: Zen Grids ར༻: SCSS .footer1 { // ৽͍͠ߦΛ࢝ΊΔ @include
zen-new-row(); // ෯͕ 3 ΧϥϜɺελʔτ͕ 5 ΧϥϜ // ඞͣ͠ࠨ͔Βॱʹ٧Ίͳͯ͘ OK @include zen-grid-item(3, 5); } .footer2 { // ෯͕ 4 ΧϥϜɺελʔτ͕ 1 ΧϥϜ @include zen-grid-item(4, 1); }
Zen 7.x-6.x SASS ϑΝΠϧߏ
Zen 7.x-6.x SASS ϑΝΠϧߏ _colors.scss (2): • ৭ؔ࿈ͷมʢ chroma ʣΛఆٛ͢Δ
_variables.scss (2): • ৭Ҏ֎ͷมΛఆٛ͢Δ
Zen 7.x-6.x SASS ϑΝΠϧߏ base/ (3) : layouts/ (4) :
components/ (5) : • SMACSS ෩ͷϨΠϠϦϯά navigation/ (6) : forms/ (7) : • ͜͜ SMACSS ෩͡Όͳ͍ • ϝχϡʔϑΥʔϜपΓ
͋Γ͕ͱ͏͍͟͝·ͨ͠