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...
Search
Tamás Hajas
November 14, 2015
Technology
0
120
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
91
What's new in CSS? Introduction to CSS Grid and CSS Custom Properties
thamas
0
65
Short Twig recipes for Drupalers
thamas
0
80
Futureproof styling (in Drupal 8)
thamas
1
270
Drupal 8 overview
thamas
0
260
Futureproof styling in Drupal
thamas
0
90
Szépségszalon a Vertikális Végtelenhez – Drupal 8 sminkelés
thamas
1
310
Hogyan írjunk fenntartható CSS-t?
thamas
0
180
Future-proof styling in Drupal (8)
thamas
0
73
Other Decks in Technology
See All in Technology
PHPカンファレンス名古屋-テックリードの経験から学んだ設計の教訓
hayatokudou
2
270
『衛星データ利用の方々にとって近いようで触れる機会のなさそうな小話 ~ 衛星搭載ソフトウェアと衛星運用ソフトウェア (実物) を動かしながらわいわいする編 ~』 @日本衛星データコミニティ勉強会
meltingrabbit
0
140
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
190
OpenID BizDay#17 KYC WG活動報告(法人) / 20250219-BizDay17-KYC-legalidentity
oidfj
0
240
TAMとre:Capセキュリティ編 〜拡張脅威検出デモを添えて〜
fujiihda
2
240
速くて安いWebサイトを作る
nishiharatsubasa
10
12k
開発スピードは上がっている…品質はどうする? スピードと品質を両立させるためのプロダクト開発の進め方とは #DevSumi #DevSumiB / Agile And Quality
nihonbuson
2
2.9k
全文検索+セマンティックランカー+LLMの自然文検索サ−ビスで得られた知見
segavvy
2
100
君も受託系GISエンジニアにならないか
sudataka
2
430
CZII - CryoET Object Identification 参加振り返り・解法共有
tattaka
0
360
Cloud Spanner 導入で実現した快適な開発と運用について
colopl
1
620
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.4k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
How GitHub (no longer) Works
holman
314
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Bash Introduction
62gerente
611
210k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Statistics for Hackers
jakevdp
797
220k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Become a Pro
speakerdeck
PRO
26
5.1k
Designing for Performance
lara
604
68k
The Language of Interfaces
destraynor
156
24k
Code Review Best Practice
trishagee
67
18k
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