Skip to content

Commit b40bf3c

Browse files
smnandreweaverryan
authored andcommitted
[Site] Update demo pages
1 parent 5979432 commit b40bf3c

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed

ux.symfony.com/assets/styles/components/_demo-container.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
border-top-right-radius: 12px;
66
}
77

8+
.demo-introduction {
9+
a {
10+
color: var(--bs-code-color);
11+
font-weight: 500;
12+
}
13+
code {
14+
font-size: .95em;
15+
}
16+
}
17+
818
.demo-container-inner {
919
background-color: var(--bs-secondary-bg);
1020
border: 1px solid var(--bs-secondary-bg-subtle);

ux.symfony.com/src/Form/MealPlannerForm.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ class MealPlannerForm extends AbstractType
2626
{
2727
public function buildForm(FormBuilderInterface $builder, array $options): void
2828
{
29+
/**
30+
* Install DynamicFormBuilder:.
31+
*
32+
* composer require symfonycasts/dynamic-forms
33+
*/
2934
$builder = new DynamicFormBuilder($builder);
3035

3136
$builder

ux.symfony.com/src/Service/LiveDemoRepository.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ public function findAll(): array
5252
description: 'After selecting the first field, automatically reload the options for a second field.',
5353
route: 'app_demo_live_component_dependent_form_fields',
5454
longDescription: <<<EOF
55-
Say goodbye to the hassle of dependent form fields with Live Components.
56-
<br>
57-
Whip up a <a href="https://symfony.com/doc/current/form/dynamic_form_modification.html#form-events-submitted-data">form with dynamic events</a> and then head out for a well-deserved lunch.
55+
Unleash the power of form events, thanks to <a href="/live-component"><code>LiveComponent</code></a>
56+
and <a href="https://github.com/SymfonyCasts/dynamic-forms"><code>DynamicForms</code></a>.
5857
EOF
5958
),
6059
new LiveDemo(

ux.symfony.com/src/Util/SourceCleaner.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ class SourceCleaner
1717
{
1818
public static function cleanupPhpFile(string $contents, bool $removeClass = false): string
1919
{
20-
$contents = u($contents)
21-
->replace("<?php\n", '')
22-
->replaceMatches('/namespace[^\n]*/', '');
20+
$contents = u($contents)->replace("<?php\n", '');
21+
22+
// Remove LICENCE header
23+
if ($contents->indexOf('* This file is part of the Symfony package')) {
24+
$contents = $contents->after(' */');
25+
}
26+
27+
$contents = $contents->replaceMatches('/namespace[^\n]*/', '');
2328

2429
if ($removeClass) {
2530
$contents = $contents->replaceMatches('/class[^\n]*\n{/', '')

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
{{ stimulus_target('code-expander', 'expandCodeButton') }}
2727
{{ stimulus_action('code-expander', 'expandCode') }}
2828
style="display: none;"
29-
>Expand code</button>
29+
>
30+
<twig:Icon name="arrow-down" />
31+
Expand code
32+
<twig:Icon name="arrow-down" />
33+
</button>
3034
{% endblock %}
3135
</div>
3236
</div>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<a href="{{ url('app_demos') }}">DEMO</a>
2525
</p>
2626
<h1 class="ubuntu text-center">{{ demo.name }}</h1>
27-
<div style="font-size: 1rem; line-height: 1.75rem;" class="mt-4">
27+
<div style="font-size: 1rem; line-height: 1.75rem;" class="mt-4 demo-introduction">
2828
{{ demo.longDescription|markdown_to_html }}
2929
</div>
3030
</div>
@@ -37,7 +37,7 @@
3737
</div>
3838

3939
<div class="container-fluid container-xxl px-4 pt-4 px-md-5 pt-md-5 mb-5">
40-
<div class="mb-3" style="position: relative;">
40+
<div class="mb-5" style="position: relative;">
4141
<div class="p-4 markdown-container bg-body shadow-blur shadow-blur--rainbow" id="demo">
4242
{% block demo_content %}{% endblock %}
4343
</div>

0 commit comments

Comments
 (0)