Slide 1

Slide 1 text

All you need is CSS Radoslav Stankov

Slide 2

Slide 2 text

!

Slide 3

Slide 3 text

Radoslav Stankov @rstankov rstankov.com

Slide 4

Slide 4 text

https://tips.rstankov.com

Slide 5

Slide 5 text

Best JavaScript Is No JavaScript

Slide 6

Slide 6 text

"

Slide 7

Slide 7 text

I ❤

Slide 8

Slide 8 text

I ❤

Slide 9

Slide 9 text

I ❤

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

SIMPLIFYING PROPERTY MANAGEMENT FOR MODERN COMMUNITIES LIVO.ME

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

$ Side project

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

% LIVO Architecture & Ruby on Rails ' No JavaScript ( No custom CSS, use Tailwind ) Extensive e2e tests * Focus on domain

Slide 17

Slide 17 text

... and for mobile apps used by inhabitants

Slide 18

Slide 18 text

+

Slide 19

Slide 19 text

% LIVO Architecture & Ruby on Rails ' No JavaScript ( No custom CSS, use Tailwind ) Extensive e2e tests * Focus on domain

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

, How to avoid writing code checklist - reduce scope, by adjusting business requirement . use build-in feature of the browser / use feature from core platform - Next / React / Angular ... 0 use type system 1 move to logic backend 2 (only when I really have to) use 3rd party library (browser edition)

Slide 22

Slide 22 text

, How to avoid writing code checklist - reduce scope, by adjusting business requirement . use build-in feature of the browser / use feature from core platform - Next / React / Angular ... 0 use type system 1 move to logic backend 2 (only when I really have to) use 3rd party library (browser edition)

Slide 23

Slide 23 text

HTML CSS JavaScript

Slide 24

Slide 24 text

Plain HTML/CSS Plain HTML/CSS Everything with JS

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

:hover

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

function MyButton() { const [isHovered, setIsHovered] = useState(false); const className = isHovered ? 'button button-hover' : 'button'; const onMouseEnter = () => setIsHovered(true); const onMouseLeave = () => setIsHovered(false); return ( Button ); }

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

css grid

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

Slide 37

Slide 37 text

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

System Requirements

Requires a computer running an operating system. The computer must have some memory and ideally some kind of long-term storage. An input device as well as some form of output device is recommended.

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text


 ... ... 


Slide 45

Slide 45 text


 ... ... 


Slide 46

Slide 46 text

details[open] .open-hidden { display: none; } details:not([open]) .open-visible { display: none; }

Slide 47

Slide 47 text

Responsive Table

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 53

Slide 53 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 54

Slide 54 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 55

Slide 55 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 56

Slide 56 text

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

3 Accessible 4 Mobile friendly 5 All batteries include ➡ No extra code 7 Single date, no range 7 Style doesn't match our site

Slide 61

Slide 61 text

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

3 Accessible 4 Build-in backdrop 5 Auto handling of forms (example: auto-focus) 8 Stops scrolling of back page 9 Auto handle of ESC : Style as you wish 7 JavaScript to trigger the modal version 7 JavaScript need to close dialog when click backdrop

Slide 66

Slide 66 text

import { setEventListners } from './utils'; setEventListners(document, { '[data-dialog]:click': (e) => { document .getElementById(e.target.closest('[data-dialog]').dataset.dialog) ?.showModal(); }, 'dialog:click': (e) => { if (e.target.tagName === 'DIALOG') { e.target.close(); } }, });

Slide 67

Slide 67 text

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

https://chatgpt.com/share/2d4606ad-c764-4db8-9ed5-158e90e8e391

Slide 73

Slide 73 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; }

Slide 74

Slide 74 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; } ... and the code fits on a slide "

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; }

Slide 77

Slide 77 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px);

Slide 78

Slide 78 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap;

Slide 79

Slide 79 text

pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before {

Slide 80

Slide 80 text

line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; }

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

https://codepen.io/web-dot-dev/pen/gbOKyRZ On On Off

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

... in 2025/2026 ;

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

https://rstankov.com/appearances