Skip to content

Commit 38998c1

Browse files
committed
minor #1804 [Site] Various small fixes / improvements (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Site] Various small fixes / improvements A lot of small things grouped in a medium-sized PR 👼 - Lint templates - Normalize template names - Fix some spacings - Fix CodeBlock expander - SVG image for header logo - Improve CodeBlocWithComment readability - Rework code block expand button - Fix terminal style - Add missing doc cards in "footer" - Remove unused image - Compress 2 photos & win 8MB - Clean clipboard controller(s) - Fix header padding - Fix Icon cards on Safari - Simplify Turbo chat icon - Remove Playfair Commits ------- e0bda68 [Site] Various small fixes / improvements
2 parents db88684 + e0bda68 commit 38998c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+197
-172
lines changed

ux.symfony.com/assets/controllers/code-expander-controller.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ import { Controller } from '@hotwired/stimulus';
44
export default class extends Controller {
55
static targets = ['useStatements', 'expandCodeButton', 'codeContent'];
66

7-
connect() {
8-
if (this.hasExpandCodeButtonTarget && this.#isOverflowing(this.codeContentTarget)) {
9-
this.expandCodeButtonTarget.style.display = 'block';
10-
// add extra padding so the button doesn't block the code
11-
this.codeContentTarget.classList.add('pb-5');
12-
}
13-
}
14-
157
expandUseStatements(event) {
168
this.useStatementsTarget.style.display = 'block';
179
event.currentTarget.remove();
@@ -21,7 +13,6 @@ export default class extends Controller {
2113
this.codeContentTarget.style.height = 'auto';
2214
if (this.hasExpandCodeButtonTarget) {
2315
this.expandCodeButtonTarget.remove();
24-
this.codeContentTarget.classList.remove('pb-5');
2516
}
2617
}
2718

ux.symfony.com/assets/controllers/ux-clipboard-controller.js

Lines changed: 0 additions & 21 deletions
This file was deleted.
-6.42 MB
Loading
-2.03 MB
Loading
-79.6 KB
Binary file not shown.

ux.symfony.com/assets/styles/app.scss

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,7 @@
110110
@import "./container";
111111
@import "./images";
112112

113-
// TODO move Terminal/CodeBlock
114-
.btn-expand-code {
115-
position: absolute;
116-
bottom: 0;
117-
left: 0;
118-
width: 100%;
119-
color: rgb(156 163 175);
120-
background-color: rgb(9, 10, 11);
121-
}
122-
.btn-expand-code:hover, .btn-expand-code:active {
123-
background-color: rgb(9, 10, 11) !important;
124-
color: #fff !important;
125-
}
126113
.code-description a {
127114
text-decoration: underline;
128115
}
116+

ux.symfony.com/assets/styles/app/_font.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,3 @@
2020
url("https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/files/ubuntu-latin-700-normal.woff2") format('woff2');
2121
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
2222
}
23-
24-
/* playfair-display-latin-700-italic */
25-
@font-face {
26-
font-family: 'Playfair Display';
27-
font-style: italic;
28-
font-display: swap;
29-
font-weight: 700;
30-
src: local("Playfair Display Bold Italic"),
31-
local("PlayfairDisplay-Bold-Italic"),
32-
url("https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/files/playfair-display-latin-700-italic.woff2") format('woff2');
33-
}

ux.symfony.com/assets/styles/app/_html.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ button {
4141
border: none;
4242
background: inherit;
4343
}
44+
button:active {
45+
border: inherit;
46+
}
4447

4548
a.link {
4649
--color: #d9438e;

ux.symfony.com/assets/styles/app/_root.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
// Fonts
1717
--font-family-title: "Ubuntu";
18-
--font-family-decorative: "Playfair Display";
1918
--font-family-text: system-ui, sans-serif;
2019
--font-family-code: ui-monospace, "SF Mono", SFMono-Regular, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
2120

ux.symfony.com/assets/styles/app/_typography.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ h1.ubuntu {
99
line-height: 60px;
1010
}
1111

12-
h1 .playfair {
13-
font-style: italic;
14-
line-height: 70px;
15-
}
16-
1712
h2.ubuntu {
1813
font-size: 42px;
1914
font-weight: 700;
@@ -88,12 +83,6 @@ h4.ubuntu {
8883
letter-spacing: -1px;
8984
}
9085

91-
h1.playfair {
92-
font-size: 36px;
93-
line-height: 48px;
94-
letter-spacing: -1px;
95-
}
96-
9786
h2.ubuntu {
9887
font-size: 28px;
9988
line-height: 32px;

ux.symfony.com/assets/styles/components/_IconGrid.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
aspect-ratio: 1;
2222
position: relative;
2323
transition: 150ms linear;
24+
place-content: stretch;
25+
align-content: center;
2426
}
2527

2628
.IconCard:hover {
@@ -34,6 +36,8 @@
3436
place-items: center;
3537
align-content: center;
3638
position: relative;
39+
aspect-ratio: 1;
40+
width: 100%;
3741
}
3842

3943
.IconCard__icon {
@@ -54,6 +58,7 @@
5458
line-height: 1.1;
5559
display: none;
5660
transition: opacity 125ms linear;
61+
color: var(--bs-body-color);
5762
}
5863

5964
.IconCard__name {

ux.symfony.com/assets/styles/components/_PackageHeader.scss

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,16 @@
33
text-shadow: 0 .25rem .25rem rgba(0, 0, 0, .05);
44

55
em {
6-
font-family: var(--font-family-decorative);
7-
padding-inline-start: .5rem;
6+
display: inline-flex;
7+
transform: skewX(-16deg) scaleY(0.95) rotate(-.5deg);
8+
font-weight: 400;
9+
text-shadow: 0 .25rem .25rem rgba(0, 0, 0, .1);
10+
mix-blend-mode: luminosity;
11+
font-style: normal;
812
}
913
}
1014

1115
.AppHeader + * & {
1216
padding-top: 3rem;
1317
}
14-
15-
[data-bs-theme="dark"] & {
16-
background-blend-mode: hue !important;
17-
// background-blend-mode: soft-light;
18-
}
19-
20-
.nav-options {
21-
font-family: var(--font-family-title);
22-
font-weight: 700;
23-
font-size: 15px;
24-
line-height: 20px;
25-
letter-spacing: 0px;
26-
color: #fff;
27-
}
28-
29-
.nav-options-icon {
30-
font-size: 20px;
31-
}
3218
}

ux.symfony.com/assets/styles/components/_Terminal.scss

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
transition: all 250ms ease-in-out;
118118
&:hover {
119119
color: $n-100;
120-
background-color: $n-800;
121120
}
122121
}
123122
.btn-link:hover {
@@ -145,8 +144,46 @@
145144
overflow-x: auto;
146145
overflow-y: auto;
147146
padding: 1rem;
148-
149147
pre {
150148
overflow: visible;
151149
}
150+
scrollbar-width: thin;
151+
}
152+
153+
@media screen and (min-width: 768px) {
154+
.Terminal_content::-webkit-scrollbar {
155+
display: none;
156+
}
157+
.Terminal_content {
158+
--webkit-scrollbar-width: none;
159+
scrollbar-width: none;
160+
}
161+
}
162+
163+
.Terminal_expand {
164+
position: absolute;
165+
bottom: 5px;
166+
right: 5px;
167+
width: auto;
168+
color: rgb(156, 163, 175);
169+
background-color: rgb(9, 10, 11);
170+
border-radius: 1rem;
171+
font-size: smaller;
172+
display: inline-flex !important;
173+
align-items: center;
174+
padding: .25rem .75rem;
175+
flex-direction: row;
176+
gap: 0.5rem;
177+
opacity: .35;
178+
transition: all 250ms;
179+
text-transform: capitalize;
180+
}
181+
182+
.Terminal:hover .Terminal_expand {
183+
background-color: rgb(9, 10, 11) !important;
184+
opacity: .7;
185+
}
186+
.Terminal_expand:hover, .Terminal_expand:active {
187+
color: #fff !important;
188+
opacity: 1;
152189
}

ux.symfony.com/assets/styles/sections/_header.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,19 @@ body.locked {
5858
--height: 2rem;
5959
height: var(--height);
6060
width: calc(161 / 30 * var(--height));
61-
background: url(../images/sf-ux.svg);
62-
background-size: 100%;
6361
display: block;
6462
transition: filter 250ms ease-in;
6563
flex-shrink: 0;
66-
span {
67-
display: none;
68-
}
6964
.AppHeader--white &,
7065
[data-bs-theme="dark"] & {
7166
filter: invert(1);
7267
}
68+
img {
69+
display: block;
70+
width: 100%;
71+
height: 100%;
72+
object-fit: fill;
73+
}
7374
}
7475

7576
.AppHeader_toggler {
@@ -86,6 +87,9 @@ body.locked {
8687
}
8788

8889
@media (min-width: 860px) {
90+
.AppHeader_logo {
91+
--height: 2.5rem;
92+
}
8993
.AppHeader_toggler {
9094
display: none !important;
9195
}

ux.symfony.com/assets/styles/utilities/_font.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
font-family: var(--font-family-title);
33
}
44

5-
.playfair {
6-
font-family: var(--font-family-decorative);
7-
}
8-
95
.font-title {
106
font-family: var(--font-family-title);
117
}

ux.symfony.com/assets/styles/utilities/_info-tooltips.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
content: " ";
1717
animation: copied 450ms linear forwards;
1818
border-radius: 50%;
19-
border: 2px dotted var(--bs-green);
19+
border: 2px dotted var(--bs-body-color);
2020
}
2121

2222
@keyframes copied {

ux.symfony.com/assets/styles/vendor/_bootstrap.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,16 @@
3535
--bs-btn-disabled-bg: transparent;
3636
--bs-btn-disabled-border-color: var(--color);
3737
}
38+
}
39+
40+
.btn-sm {
41+
--bs-border-width: 0;
42+
}
43+
.btn-sm:hover {
44+
border-color: transparent !important;
45+
border-width: 0 !important;
46+
}
3847

48+
.btn-copy {
49+
position: relative;
3950
}

ux.symfony.com/src/Controller/UxPackage/LazyImageController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __invoke(UxPackageRepository $packageRepository): Response
2424
$package = $packageRepository->find('lazy-image');
2525
$legosFilePath = $this->getParameter('kernel.project_dir').'/assets/images/legos.jpg';
2626

27-
return $this->render('ux_packages/lazy-image.html.twig', [
27+
return $this->render('ux_packages/lazy_image.html.twig', [
2828
'package' => $package,
2929
'legosFilePath' => $legosFilePath,
3030
]);

ux.symfony.com/src/Controller/UxPackage/TwigComponentController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __invoke(UxPackageRepository $packageRepository): Response
2323
{
2424
$package = $packageRepository->find('twig-component');
2525

26-
return $this->render('ux_packages/twig-component.html.twig', [
26+
return $this->render('ux_packages/twig_component.html.twig', [
2727
'package' => $package,
2828
]);
2929
}

ux.symfony.com/templates/_header.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<nav class="AppNav AppNav--white">
55

66
<a class="AppHeader_logo" href="{{ path('app_homepage') }}" aria-label="Homepage">
7-
<span aria-hidden="false">Symfony UX</span>
7+
<img src="{{ asset('images/sf-ux.svg') }}" alt="Symfony UX" width="161" height="30" />
88
</a>
99

1010
<div class="AppNav_actions">

ux.symfony.com/templates/changelog.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
{% block content %}
1111

1212
<div class="hero">
13-
<div class="container-fluid container-xxl px-4 pt-4 px-md-5 pt-md-5">
13+
<div class="container-fluid container-xxl px-4 pt-4 px-md-5">
1414
<h1 class="text-center ubuntu mt-5"><a href="{{ url('app_changelog') }}">Changelog</a></h1>
1515
<p class="text-center mt-2 mb-5">New features, bug fixes, performances and security improvements.</p>
1616
</div>
1717
</div>
1818

19-
<div class="container-fluid container-xxl px-4 pt-4 px-md-5 pt-md-5">
19+
<div class="container-fluid container-xxl px-4 pt-4 px-md-5">
2020
<div class="Changelog">
2121
{% for entry in changelog %}
2222
<twig:ChangelogItem item="{{ entry }}" isOpen="{{ loop.index < 6 }}" />

ux.symfony.com/templates/components/CodeBlock.html.twig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
}) }}>
44

55
{% if showFilename %}
6-
<div class="Terminal_header py-2 ps-4 pe-2 mb-0 d-flex justify-content-between align-items-center">
6+
<div class="Terminal_header py-2 px-3 mb-0 d-flex justify-content-between align-items-center">
77
<a id="{{ this.elementId }}" href="#{{ this.elementId }}" class="Terminal_title"><code>{{ filename }}</code></a>
88
<div class="Terminal_actions">
99
<twig:CodeBlockButtons source="{{ this.rawSource }}" link="{{ this.githubLink }}"/>
@@ -35,14 +35,12 @@
3535
{% block code_content_bottom %}
3636
<button
3737
type="button"
38-
class="btn btn-expand-code pt-2 text-center"
38+
class="Terminal_expand"
3939
data-code-expander-target="expandCodeButton"
4040
data-action="code-expander#expandCode"
41-
style="display: none;"
4241
>
4342
<twig:Icon name="arrow-down"/>
44-
Expand code
45-
<twig:Icon name="arrow-down"/>
43+
<span>Expand code</span>
4644
</button>
4745
{% endblock %}
4846
</div>

0 commit comments

Comments
 (0)