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
100
What's new in CSS? Introduction to CSS Grid and CSS Custom Properties
thamas
0
72
Short Twig recipes for Drupalers
thamas
0
83
Futureproof styling (in Drupal 8)
thamas
1
300
Drupal 8 overview
thamas
0
270
Futureproof styling in Drupal
thamas
0
95
Szépségszalon a Vertikális Végtelenhez – Drupal 8 sminkelés
thamas
1
330
Hogyan írjunk fenntartható CSS-t?
thamas
0
190
Future-proof styling in Drupal (8)
thamas
0
86
Other Decks in Technology
See All in Technology
TechLION vol.41~MySQLユーザ会のほうから来ました / techlion41_mysql
sakaik
0
120
CIでのgolangci-lintの実行を約90%削減した話
kazukihayase
0
330
実践! AIエージェント導入記
1mono2prod
0
120
AI技術トレンド勉強会 #1MCPの基礎と実務での応用
nisei_k
1
230
キャディでのApache Iceberg, Trino採用事例 -Apache Iceberg and Trino Usecase in CADDi--
caddi_eng
0
170
Amplifyとゼロからはじめた AIコーディング 成果と展望
mkdev10
1
340
SFTPコンテナからファイルをダウンロードする
dip
0
520
vLLM meetup Tokyo
jpishikawa
1
260
TerraformをSaaSで使うとAzureの運用がこんなに楽ちん!HCP Terraformって何?
mnakabayashi
0
280
QAはソフトウェアエンジニアリングを学んで実践するのが大事なの
ymty
1
490
Observability infrastructure behind the trillion-messages scale Kafka platform
lycorptech_jp
PRO
0
120
TODAY 看世界(?) 是我們在看扣啦!
line_developers_tw
PRO
0
950
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
A better future with KSS
kneath
239
17k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
4
190
The Pragmatic Product Professional
lauravandoore
35
6.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Thoughts on Productivity
jonyablonski
69
4.7k
YesSQL, Process and Tooling at Scale
rocio
172
14k
It's Worth the Effort
3n
184
28k
Making Projects Easy
brettharned
116
6.2k
Embracing the Ebb and Flow
colly
86
4.7k
RailsConf 2023
tenderlove
30
1.1k
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