Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Szépségszalon a vertikális végtelenhez – Drupal 8 front-end fejlesztés
Search
Tamás Hajas
November 14, 2015
Technology
0
100
Szépségszalon a vertikális végtelenhez – Drupal 8 front-end fejlesztés
Drupal sminkelés előadásom #webkonfhu 2015 változata.
http://webconf.hu/2015/program/index.php
Tamás Hajas
November 14, 2015
Tweet
Share
More Decks by Tamás Hajas
See All by Tamás Hajas
Variable fonts in the real world
thamas
0
76
What's new in CSS? Introduction to CSS Grid and CSS Custom Properties
thamas
0
54
Short Twig recipes for Drupalers
thamas
0
72
Futureproof styling (in Drupal 8)
thamas
1
250
Drupal 8 overview
thamas
0
250
Futureproof styling in Drupal
thamas
0
82
Szépségszalon a Vertikális Végtelenhez – Drupal 8 sminkelés
thamas
1
270
Hogyan írjunk fenntartható CSS-t?
thamas
0
170
Future-proof styling in Drupal (8)
thamas
0
64
Other Decks in Technology
See All in Technology
エンジニア向け会社紹介資料
caddi_eng
14
220k
エンジニアの生存戦略 〜クラウド潮流の経験から紐解く技術トレンドのメカニズムと乗りこなし方〜
shimy
9
1.9k
サービスの持続的な成長と技術負債について
siva_official
PRO
10
4.4k
「我々はどこに向かっているのか」を問い続けるための仕組みづくり / Establishing a System for Continuous Inquiry about where we are
daitasu
0
170
ACRiルーム最新情報とAMD GPUサーバーのご紹介
anjn
0
150
AWSでRAGを作る法方
sonoda_mj
1
140
AIエージェントを現場に導入する目線とは
masahiro_nishimi
1
1.5k
フルリモートワークはエンジニアの夢を叶えたか? #cm_odyssey
mamohacy
2
600
AI研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
130
ギークの理想が7つ集まるエムスリーで夢を叶えよう - エムスリー株式会社
m3_engineering
1
260
How to Think Like a Performance Engineer
csswizardry
4
590
コンテナ・K8s研修 - 後半 Kubernetes 基礎&ハンズオン【MIXI 24新卒技術研修】
mixi_engineers
PRO
1
120
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
26
1.6k
Creatively Recalculating Your Daily Design Routine
revolveconf
214
11k
Gamification - CAS2011
davidbonilla
78
4.9k
Web development in the modern age
philhawksworth
203
10k
Clear Off the Table
cherdarchuk
89
320k
Fantastic passwords and where to find them - at NoRuKo
philnash
42
2.7k
Atom: Resistance is Futile
akmur
261
25k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
17
8.7k
The Power of CSS Pseudo Elements
geoffreycrofte
64
5.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
189
16k
Automating Front-end Workflow
addyosmani
1362
200k
Transcript
Szépségszalon a Vertikális Végtelenhez 8
Szépségszalon a Vertikális Végtelenhez Drupal 8 sminkelés
Hajas Tamás Web Project Manager Front-end Developer Integral Vision Kft
Hajas Tamás thamas.github.io
Smink létrehozása
Hol? [gyökérkönyvtár]/themes/custom/[sminkneve]
None
Konfig fájlok
*.info.yml *.libraries.yml *.breakpoints.yml *.theme Smink konfig fájlok
*.info.yml *.libraries.yml *.breakpoints.yml *.theme Smink konfig fájlok
alap info CSS és JS örökölt CSS és JS felülbírálása
régiók
A Drupal 8 sminkjei Seven HTML, CSS, JS változhat Bartik
HTML, CSS, JS változhat Stark HTML, CSS, JS változhat Stable HTML, CSS, JS nem változhat <div></div> Drupal 8 core HTML, CSS, JS változhat Classy HTML, CSS, JS nem változhat <div class=“foo”></div> base theme: false base theme: classy base theme:
Drupal 8 alapsmink használat Klassz Sminkem Alakuló Sminkem Stable HTML,
CSS, JS nem változhat <div></div> Drupal 8 core HTML, CSS, JS változhat Classy HTML, CSS, JS nem változhat <div class=“foo”></div> Stabil Sminkem base theme: false base theme: classy base theme:
Drupal 8 alapsmink használat Klassz Sminkem base theme: classy klasszsminkem.info.yml
<div class="node node--article"> … </div> HTML kimenet (Nem fog változni Drupal 8.x-ben)
Drupal 8 alapsmink használat base theme: false alakulosminkem.info.yml <div class="node
node--article"> … </div> HTML kimenet (Megváltozhat! CSS, JS is!) Alakuló Sminkem
Drupal 8 alapsmink használat stabilsminkem.info.yml Stabil Sminkem base theme nincs
megadva <div> … </div> HTML kimenet (Nem fog változni Drupal 8.x-ben) Change record: https://www.drupal.org/node/2580687
*.info.yml *.libraries.yml *.breakpoints.yml *.theme Smink konfig fájlok
# Libraries libraries: -sminkem/global-assets global-assets: version: 1.x css: theme: css/style.css:
{} css/print.css: { media: print } js: js/script.js: {} dependencies: - core/jquery - core/jquery.once sminkem.info.yml sminkem.libraries.yml https://www.drupal.org/theme-guide/8/assets
Change record: https://www.drupal.org/node/2497313 libraries override / extend sminkem.info.yml
Change record: https://www.drupal.org/node/2497313 libraries override / extend sminkem.info.yml
• Base • Layout • Component Module • State •
Theme SMACSS-szerű CSS fájl-struktúra
<div class="flower__bed"> <div class="flower flower--tulip is-pollinating"> <div class="flower__petals"> <div class="flower__face"></div>
</div> <div class="flower__stem"> <div class="flower__leaves"></div> </div> </div> </div> John Albin: Managing complex projects with design components BEM
*.info.yml *.libraries.yml *.breakpoints.yml *.theme Smink konfig fájlok
bartik.mobile: label: mobile mediaQuery: '(min-width: 0px)' weight: 0 multipliers: -
1x bartik.narrow: label: narrow mediaQuery: 'all and (min-width: 560px) and (max-width: 850px)' weight: 1 multipliers: - 1x bartik.wide: label: wide mediaQuery: 'all and (min-width: 851px)' weight: 2 multipliers: - 1x bartik.breakpoints.yml
None
*.info.yml *.libraries.yml *.breakpoints.yml *.theme Smink konfig fájlok
bartik.theme
Sablonrendszer
html page region region region region node block field field
field field field field
None
Twig sablonok https://www.drupal.org/theme-guide/8/twig
block.html.twig
Twig coding standards: https://drupal.org/node/1823416 *.html.twig {{ változó }} {# kód
komment #} {% utasítás %}
{% if site_slogan %} <div class="site-slogan"> {{ site_slogan }} </div>
{% endif %} {# Show slogan if it is set #} *.html.twig
$yo[‘drupal_where’]->is[‘und’][0]–>my_data Drupal 7 :(
*.html.twig változón elemének megjelenítése {{ content.links.readmore }}
*.html.twig változó megjelenítése kihagyással {{ content|without('image') }} változó (tömb) szűrő
változó elemének neve
{{ html }} {{ page }} {{ page.header }} {{
page.aside }} {{ page.footer }} {{ page.content }} {{ content }} {{ submitted }} {{ tags }} {{ text }} {{ image }} field field
{{ html }} {{ page }} {{ page.header }} {{
page.aside }} {{ page.footer }} {{ page.content }} {{ content|without(‘image’) }} {{ submitted }} {{ tags }} {{ text }} {{ content.image }}
{{ html }} {{ page }} {{ page.header }} {{
page.aside }} {{ page.footer }} {{ page.content }} {{ content|without(‘image’,’tags’) }} {{ submitted }} {{ content.tags }} {{ text }} {{ content.image }}
https://www.drupal.org/node/2296163 {{ username|raw }} *.html.twig autoescape Kép: http://www.legalleadersblog.com/2012/04/30/ you-gotta-feel-sorry-for-those-angry-difficult-partners/
{% set foo="Bar" %} {{ foo }} … Bar *.html.twig
változó definiálása utasítás változó értéke változó neve eredmény
*.html.twig változó definiálása tömb tartalomtípus pl. „article” összefűzés
{<div{{ attributes }}> block.html.twig html attribútumok
<article{{ attributes.addClass(classes) }}> *.html.twig attribútumok kezelése
attribútumok kezelése *.html.twig
{% trans %} Submitted by {{ author_name|passthrough }} on {{
date|passthrough }} {% endtrans %} {{ ‘webconf’|t }} *.html.twig fordítás
XYZ oldal Copyleft… T artalom címe Twig block
Twig block page.html.twig
Twig block page--front.html.twig
Twig block page.html.twig XYZ oldal Copyleft… Üdv a címlapon!
Eszközök
parameters: twig.config: debug: true auto_reload: true cache: false sites/default/services.yml Twig
debug
Twig debug
Twig debug
Forrás: https://drupalize.me/blog/201405/lets-debug-twig-drupal-8 Devel + Devel Kint modulok
• https://drupal.org/theme-guide/8 • Change records (theme): http://j.mp/1qFSKXq • https://events.drupal.org/barcelona2015/ sessions/drupal-8-theming-0
• Twig Coding Standards: https://drupal.org/node/ 1823416 • CSS CS: https://drupal.org/node/1886770 • JS CS: https://drupal.org/node/172169 további infók Nagyban építettem erre!
Hajas Tamás Web Project Manager Front-end Developer Integral Vision Kft
integralvision.hu thamas.github.io