From 7401611001e682f2ccc0003ef795eaa6f888e1ea Mon Sep 17 00:00:00 2001 From: Victor Bocharsky Date: Mon, 4 Sep 2023 18:16:14 +0200 Subject: [PATCH 01/13] Update ux.symfony.com local deployment instructions --- ux.symfony.com/README.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/ux.symfony.com/README.md b/ux.symfony.com/README.md index b2a26ad8931..660a434b7aa 100644 --- a/ux.symfony.com/README.md +++ b/ux.symfony.com/README.md @@ -9,32 +9,42 @@ Source code for [ux.symfony.com](https://ux.symfony.com). 1. Install the project: ```bash git clone git@github.com:symfony/ux - cd ux/ux.symfony.com + cd ux/ux.symfony.com/ ``` + 2. Install the dependencies: ```bash - composer install + symfony composer install ``` -3. (optional) Configure docker: + +3. (optional) Configure Docker: ```bash docker compose up -d ``` -4. Populate the database: + +5. Run database migrations: + ```bash + symfony console doctrine:migration:migrate + ``` + +6. Populate the database: ```bash symfony console app:load-data ``` -5. Start the web server: + +7. Compile the Sass files: ```bash - symfony server:start -d + symfony console sass:build --watch ``` -6. Compile the Sass files: +8. Start the web server: ```bash - php bin/console sass:build --watch + symfony server:start -d ``` + ### Running the Test Suite ```bash -vendor/bin/phpunit +symfony php bin/phpunit ``` From efa9427821e70c35b09e598b1559a60f0877de76 Mon Sep 17 00:00:00 2001 From: Victor Bocharsky Date: Mon, 4 Sep 2023 16:15:35 +0200 Subject: [PATCH 02/13] Add a missing colon and fix misprint in the docs --- src/LiveComponent/doc/index.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/LiveComponent/doc/index.rst b/src/LiveComponent/doc/index.rst index ae76306647a..7e38f52a7d8 100644 --- a/src/LiveComponent/doc/index.rst +++ b/src/LiveComponent/doc/index.rst @@ -1087,7 +1087,7 @@ the ``#[LiveArg()]`` attribute:: } Normally, the argument name in PHP - e.g. ``$id`` - should match the -argument named used in Twig ``id={{ item.id }}``. But if they don't +argument name used in Twig ``id={{ item.id }}``. But if they don't match, you can pass an argument to ``LiveArg``, like we did with ``itemName``. Actions and CSRF Protection @@ -1153,7 +1153,7 @@ the component now extends ``AbstractController``! That is totally allowed, and gives you access to all of your normal controller shortcuts. We even added a flash message! -.. _files +.. _files: Uploading files --------------- @@ -1172,7 +1172,7 @@ to handle the files and tell the component when the file should be sent: + +Then use your component with ``:`` to navigate through sub-directories (if there are any): + +.. code-block:: html+twig + + {# index.html.twig #} + ... +
+ Click Me! +
+ + {# renders as: #} + + +Like normal, you can pass extra attributes that will be rendered on the element: + +.. code-block:: html+twig + + {# index.html.twig #} + ... +
+ Click Me! +
+ + {# renders as: #} + + +You can also pass a variable (prop) into your template: + +.. code-block:: html+twig + + {# index.html.twig #} + ... +
+ Click Me! +
+ +To tell the system that ``icon`` and ``type`` are props and not attributes, use the ``{% props %}`` tag at the top of your template. + +.. code-block:: html+twig + + {# templates/components/Button.html.twig #} + {% props icon = null, type = 'primary' %} + + + Test Helpers ------------ From 9591ea8935098930ce1f5e27e119fbc4426afb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Berengu=C3=A9?= Date: Wed, 6 Sep 2023 08:50:09 +0200 Subject: [PATCH 10/13] Don't store ux_live_component URLs in setTargetPath of the security component --- src/LiveComponent/assets/dist/live_controller.js | 1 + src/LiveComponent/assets/src/Backend/RequestBuilder.ts | 1 + src/LiveComponent/assets/test/Backend/RequestBuilder.test.ts | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/LiveComponent/assets/dist/live_controller.js b/src/LiveComponent/assets/dist/live_controller.js index 0af46087a6f..85fe146a88a 100644 --- a/src/LiveComponent/assets/dist/live_controller.js +++ b/src/LiveComponent/assets/dist/live_controller.js @@ -2154,6 +2154,7 @@ class RequestBuilder { const fetchOptions = {}; fetchOptions.headers = { Accept: 'application/vnd.live-component+html', + 'X-Requested-With': 'XMLHttpRequest', }; const totalFiles = Object.entries(files).reduce((total, current) => total + current.length, 0); const hasFingerprints = Object.keys(children).length > 0; diff --git a/src/LiveComponent/assets/src/Backend/RequestBuilder.ts b/src/LiveComponent/assets/src/Backend/RequestBuilder.ts index 2fe6e3b0254..d43dfdb5bca 100644 --- a/src/LiveComponent/assets/src/Backend/RequestBuilder.ts +++ b/src/LiveComponent/assets/src/Backend/RequestBuilder.ts @@ -25,6 +25,7 @@ export default class { const fetchOptions: RequestInit = {}; fetchOptions.headers = { Accept: 'application/vnd.live-component+html', + 'X-Requested-With': 'XMLHttpRequest', }; const totalFiles = Object.entries(files).reduce( diff --git a/src/LiveComponent/assets/test/Backend/RequestBuilder.test.ts b/src/LiveComponent/assets/test/Backend/RequestBuilder.test.ts index 1963a7fbbad..ecd569cdfad 100644 --- a/src/LiveComponent/assets/test/Backend/RequestBuilder.test.ts +++ b/src/LiveComponent/assets/test/Backend/RequestBuilder.test.ts @@ -16,6 +16,7 @@ describe('buildRequest', () => { expect(fetchOptions.method).toEqual('GET'); expect(fetchOptions.headers).toEqual({ Accept: 'application/vnd.live-component+html', + 'X-Requested-With': 'XMLHttpRequest', }); }); @@ -38,6 +39,7 @@ describe('buildRequest', () => { expect(fetchOptions.headers).toEqual({ Accept: 'application/vnd.live-component+html', 'X-CSRF-TOKEN': '_the_csrf_token', + 'X-Requested-With': 'XMLHttpRequest', }); const body = fetchOptions.body; expect(body).toBeInstanceOf(FormData); @@ -100,6 +102,7 @@ describe('buildRequest', () => { expect(fetchOptions.headers).toEqual({ // no token Accept: 'application/vnd.live-component+html', + 'X-Requested-With': 'XMLHttpRequest', }); const body = fetchOptions.body; expect(body).toBeInstanceOf(FormData); @@ -180,6 +183,7 @@ describe('buildRequest', () => { expect(fetchOptions.headers).toEqual({ Accept: 'application/vnd.live-component+html', 'X-CSRF-TOKEN': '_the_csrf_token', + 'X-Requested-With': 'XMLHttpRequest', }); const body = fetchOptions.body; expect(body).toBeInstanceOf(FormData); @@ -204,6 +208,7 @@ describe('buildRequest', () => { expect(fetchOptions.headers).toEqual({ Accept: 'application/vnd.live-component+html', 'X-CSRF-TOKEN': '_the_csrf_token', + 'X-Requested-With': 'XMLHttpRequest', }); const body = fetchOptions.body; expect(body).toBeInstanceOf(FormData); From 6cf75f511deeab3e6fa40d69a5ecf9b141cfe3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Wed, 30 Aug 2023 13:03:28 +0200 Subject: [PATCH 11/13] [Site] Dark mode theme --- .../controllers/theme-switcher-controller.js | 9 + .../assets/images/icons/theme-dark.svg | 4 + .../assets/images/icons/theme-light.svg | 3 + .../assets/images/icons/theme-switcher.svg | 3 + .../assets/images/sf-ux-logo-white.svg | 26 -- ux.symfony.com/assets/images/sf-ux-logo.svg | 1 - ux.symfony.com/assets/images/sf-ux.svg | 4 + ux.symfony.com/assets/styles/_container.scss | 183 +------------- ux.symfony.com/assets/styles/_images.scss | 42 +--- ux.symfony.com/assets/styles/_live_demos.scss | 3 - ux.symfony.com/assets/styles/_navigation.scss | 18 -- ux.symfony.com/assets/styles/_terminal.scss | 102 -------- ux.symfony.com/assets/styles/_type.scss | 231 ------------------ ux.symfony.com/assets/styles/_variables.scss | 20 +- ux.symfony.com/assets/styles/app.scss | 140 ++++++----- ux.symfony.com/assets/styles/app/_html.scss | 37 +++ ux.symfony.com/assets/styles/app/_root.scss | 25 ++ .../assets/styles/app/_typography.scss | 130 ++++++++++ .../assets/styles/components/_DocsLink.scss | 62 +++++ .../assets/styles/components/_PackageBox.scss | 26 +- .../styles/components/_PackageHeader.scss | 27 ++ .../assets/styles/components/_Terminal.scss | 139 +++++++++++ .../styles/components/_TerminalCommand.scss | 57 +++++ .../styles/components/_ThemeSwitcher.scss | 40 +++ .../styles/components/_demo-container.scss | 27 ++ .../assets/styles/components/_file_tree.scss | 47 ++++ .../assets/styles/layouts/_grid.scss | 9 + .../assets/styles/sections/_header.scss | 49 ++++ .../assets/styles/sections/_hero.scss | 48 ++++ .../assets/styles/sections/_nav.scss | 66 +++++ .../assets/styles/utilities/_arrow.scss | 31 +++ .../assets/styles/utilities/_background.scss | 9 + .../assets/styles/utilities/_font.scss | 19 ++ .../styles/utilities/_info-tooltips.scss | 7 + .../assets/styles/utilities/_shadow.scss | 17 ++ .../assets/styles/utilities/_text.scss | 19 ++ .../assets/styles/vendor/_bootstrap.scss | 48 ++++ .../styles/{ => vendor}/_highlight.scss | 1 - .../assets/styles/vendor/_tom-select.scss | 22 ++ ux.symfony.com/public/site.webmanifest | 1 - ux.symfony.com/src/Model/Package.php | 6 + .../src/Service/PackageRepository.php | 30 ++- ux.symfony.com/templates/_footer.html.twig | 50 ++++ ux.symfony.com/templates/_header.html.twig | 20 ++ ux.symfony.com/templates/_main_nav.html.twig | 55 ----- ux.symfony.com/templates/_nav.html.twig | 46 ++++ ux.symfony.com/templates/base.html.twig | 77 +++--- .../TwigBundle/Exception/error.html.twig | 29 +++ .../templates/components/CodeBlock.html.twig | 28 +-- .../templates/components/DocsLink.html.twig | 23 +- .../templates/components/PackageBox.html.twig | 2 +- .../components/PackageHeader.html.twig | 25 +- .../components/TabbedCodeBlocks.html.twig | 40 +-- .../templates/components/Terminal.html.twig | 20 +- .../components/TerminalCommand.html.twig | 13 + .../components/ThemeSwitcher.html.twig | 10 + .../components/TodoListForm.html.twig | 2 +- .../templates/cropper/cropper.html.twig | 2 +- .../templates/liveDemoBase.html.twig | 68 +++--- .../live_component/live_component.html.twig | 28 ++- .../main/_documentationLinks.html.twig | 46 ++-- .../templates/main/_fileTreeLevel.html.twig | 2 +- .../templates/main/_installTerminal.html.twig | 22 +- .../templates/main/_package_in_list.html.twig | 2 +- .../templates/main/_packagesList.html.twig | 3 +- .../templates/main/_testimonials.html.twig | 64 ----- .../templates/main/homepage.html.twig | 76 +++--- .../templates/main/packages.html.twig | 26 +- .../templates/packageBase.html.twig | 12 +- .../templates/turbo/turbo.html.twig | 100 ++++---- .../ux_packages/translator.html.twig | 39 ++- .../ux_packages/twig-component.html.twig | 8 +- .../tests/Unit/Util/SourceCleanerTest.php | 2 +- 73 files changed, 1616 insertions(+), 1112 deletions(-) create mode 100644 ux.symfony.com/assets/controllers/theme-switcher-controller.js create mode 100644 ux.symfony.com/assets/images/icons/theme-dark.svg create mode 100644 ux.symfony.com/assets/images/icons/theme-light.svg create mode 100644 ux.symfony.com/assets/images/icons/theme-switcher.svg delete mode 100644 ux.symfony.com/assets/images/sf-ux-logo-white.svg delete mode 100644 ux.symfony.com/assets/images/sf-ux-logo.svg create mode 100644 ux.symfony.com/assets/images/sf-ux.svg delete mode 100644 ux.symfony.com/assets/styles/_live_demos.scss delete mode 100644 ux.symfony.com/assets/styles/_navigation.scss delete mode 100644 ux.symfony.com/assets/styles/_terminal.scss delete mode 100644 ux.symfony.com/assets/styles/_type.scss create mode 100644 ux.symfony.com/assets/styles/app/_html.scss create mode 100644 ux.symfony.com/assets/styles/app/_root.scss create mode 100644 ux.symfony.com/assets/styles/app/_typography.scss create mode 100644 ux.symfony.com/assets/styles/components/_DocsLink.scss create mode 100644 ux.symfony.com/assets/styles/components/_PackageHeader.scss create mode 100644 ux.symfony.com/assets/styles/components/_Terminal.scss create mode 100644 ux.symfony.com/assets/styles/components/_TerminalCommand.scss create mode 100644 ux.symfony.com/assets/styles/components/_ThemeSwitcher.scss create mode 100644 ux.symfony.com/assets/styles/components/_demo-container.scss create mode 100644 ux.symfony.com/assets/styles/components/_file_tree.scss create mode 100644 ux.symfony.com/assets/styles/layouts/_grid.scss create mode 100644 ux.symfony.com/assets/styles/sections/_header.scss create mode 100644 ux.symfony.com/assets/styles/sections/_hero.scss create mode 100644 ux.symfony.com/assets/styles/sections/_nav.scss create mode 100644 ux.symfony.com/assets/styles/utilities/_arrow.scss create mode 100644 ux.symfony.com/assets/styles/utilities/_background.scss create mode 100644 ux.symfony.com/assets/styles/utilities/_font.scss create mode 100644 ux.symfony.com/assets/styles/utilities/_info-tooltips.scss create mode 100644 ux.symfony.com/assets/styles/utilities/_shadow.scss create mode 100644 ux.symfony.com/assets/styles/utilities/_text.scss create mode 100644 ux.symfony.com/assets/styles/vendor/_bootstrap.scss rename ux.symfony.com/assets/styles/{ => vendor}/_highlight.scss (99%) create mode 100644 ux.symfony.com/assets/styles/vendor/_tom-select.scss create mode 100644 ux.symfony.com/templates/_footer.html.twig create mode 100644 ux.symfony.com/templates/_header.html.twig delete mode 100644 ux.symfony.com/templates/_main_nav.html.twig create mode 100644 ux.symfony.com/templates/_nav.html.twig create mode 100644 ux.symfony.com/templates/bundles/TwigBundle/Exception/error.html.twig create mode 100644 ux.symfony.com/templates/components/TerminalCommand.html.twig create mode 100644 ux.symfony.com/templates/components/ThemeSwitcher.html.twig delete mode 100644 ux.symfony.com/templates/main/_testimonials.html.twig diff --git a/ux.symfony.com/assets/controllers/theme-switcher-controller.js b/ux.symfony.com/assets/controllers/theme-switcher-controller.js new file mode 100644 index 00000000000..c638188e7a9 --- /dev/null +++ b/ux.symfony.com/assets/controllers/theme-switcher-controller.js @@ -0,0 +1,9 @@ +import { Controller } from '@hotwired/stimulus'; + +export default class extends Controller { + switch() { + const theme = localStorage.getItem('user-theme') === 'dark' ? 'light' : 'dark'; + localStorage.setItem('user-theme', theme); + document.documentElement.setAttribute('data-bs-theme', theme); + } +} diff --git a/ux.symfony.com/assets/images/icons/theme-dark.svg b/ux.symfony.com/assets/images/icons/theme-dark.svg new file mode 100644 index 00000000000..71983b8ff65 --- /dev/null +++ b/ux.symfony.com/assets/images/icons/theme-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ux.symfony.com/assets/images/icons/theme-light.svg b/ux.symfony.com/assets/images/icons/theme-light.svg new file mode 100644 index 00000000000..e151ae69718 --- /dev/null +++ b/ux.symfony.com/assets/images/icons/theme-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/ux.symfony.com/assets/images/icons/theme-switcher.svg b/ux.symfony.com/assets/images/icons/theme-switcher.svg new file mode 100644 index 00000000000..29896595535 --- /dev/null +++ b/ux.symfony.com/assets/images/icons/theme-switcher.svg @@ -0,0 +1,3 @@ + + + diff --git a/ux.symfony.com/assets/images/sf-ux-logo-white.svg b/ux.symfony.com/assets/images/sf-ux-logo-white.svg deleted file mode 100644 index 9493b4703c7..00000000000 --- a/ux.symfony.com/assets/images/sf-ux-logo-white.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - Artboard Copy 40 - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ux.symfony.com/assets/images/sf-ux-logo.svg b/ux.symfony.com/assets/images/sf-ux-logo.svg deleted file mode 100644 index 9521ce957a6..00000000000 --- a/ux.symfony.com/assets/images/sf-ux-logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ux.symfony.com/assets/images/sf-ux.svg b/ux.symfony.com/assets/images/sf-ux.svg new file mode 100644 index 00000000000..141a4e57e63 --- /dev/null +++ b/ux.symfony.com/assets/images/sf-ux.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ux.symfony.com/assets/styles/_container.scss b/ux.symfony.com/assets/styles/_container.scss index b44d6cba9e7..438e1f686af 100644 --- a/ux.symfony.com/assets/styles/_container.scss +++ b/ux.symfony.com/assets/styles/_container.scss @@ -1,186 +1,29 @@ -.light-container { - background-color: white; - border: 1px solid $n-100; - border-radius: 12px; - min-height: 158px; -} +.components-container { + background: var(--bs-body-bg); + border-radius: 15px; + border: 0.66px solid var(--bs-secondary-bg-subtle); -.install-terminal-header-container { - background: #000; - position: absolute; - bottom: -20px; - border-radius: 4px; + h4 { margin-bottom: 0; - - input { - background: none; - color: #fff; - border: none; - outline: none - } - - button { - background: none; - color: #fff; - border: none; - } -} - -.components-container { - background: #fff; - border-radius: 15px; - border: 0.67px solid #E7E7E7; + } } .ux-container { - border: 1px solid $n-100; - border-radius: 12px; -} - - - -.demo-container { - background-color: white; - border: 1px solid $n-100; - border-top-left-radius: 12px; - border-top-right-radius: 12px; - -} - -.demo-container-inner { - background-color: $n-50; - border:1px solid $n-100; - border-top: transparent; - border-bottom-left-radius: 12px; - border-bottom-right-radius: 12px; -} - -.demo-container-inner-secondary { - background-color: #DADCE1; - border:1px solid $n-100; - border-top: transparent; - border-bottom-left-radius: 12px; - border-bottom-right-radius: 12px; -} - -.demo-chat>.demo-container-inner { - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; + border: 1px solid var(--bs-secondary-bg-subtle); + border-radius: 12px; } .markdown-container { - background-color: white; - border: 1px solid $n-100; + border: 1px solid var(--bs-secondary-bg-subtle); border-radius: 5px; height: 100%; width: 100%; position: relative; } -.rainbow-gradient::after { - content: ''; - background-image: url(../images/rainbow.png); - position: absolute; - height: 200px; +.markdown-form-render-container { + background-color: var(--bs-body-bg); + border: 1px solid var(--bs-border-color); + border-radius: 4px; width: 100%; - top: 10%; - right: 0px; - z-index: -1; - background-size: contain; - background-repeat: no-repeat; -} - -@media (max-width: 1080px) { - .rainbow-gradient::after { - top: 25%; - } -} - -@media (max-width: 930px) { - .rainbow-gradient::after { - top: 35%; - } -} - -@media (max-width: 800px) { - .rainbow-gradient::after { - top: 47%; - } -} - -@media (max-width: 767px) { - .rainbow-gradient::after { - top: 75%; - } } - -@media (max-width: 500px) { - .rainbow-gradient::after { - top: 85%; - } -} - -.markdown-form-render-container{ - border: 1px solid $n-100; - background-color: $n-50; - border-radius: 4px; - width: 100%; -} - -.testimonial-container { - background-color: $n-50; - padding: 20px; - border-radius: 12px; -} - -.testimonial-large { - font-size: 28px; - line-height: 50px; -} - - -.file-tree ul { - display: flex; - flex-direction: column; - align-items: stretch; - justify-content: flex-start; -} -.file-tree li > span { - display: flex; - flex-direction: row; - gap: 1rem; -} - -.file-tree-main::before { - background: none!important; -} - -.file-tree ul { - position: relative; - padding-inline-start: 1rem; -} - -.file-tree .tooltip-inner { - max-width: 350px; -} -.file-tree.nodots ul :not(span) { - margin-left: 12px; -} -.file-tree ul::before { - content: ''; - width: 1rem; - background: url(../images/dot.svg) left top / 2px 2px; - display: block; - position: absolute; -} -.file-tree ul::before { - top: 0; - height: 100%; - background-repeat: repeat-y; - background-position: center; - left: 0; - z-index: -1; -} - - - diff --git a/ux.symfony.com/assets/styles/_images.scss b/ux.symfony.com/assets/styles/_images.scss index 6efd73fcdf5..0f295ed2daf 100644 --- a/ux.symfony.com/assets/styles/_images.scss +++ b/ux.symfony.com/assets/styles/_images.scss @@ -10,42 +10,8 @@ border-radius: 12px; } -.nav-component-img { - width: 20px; - height: 20px; - border-radius: 3px; +.img-dark-negative { + [data-bs-theme="dark"] & { + filter: invert(100%) hue-rotate(180deg); + } } - -.testimonial-img { - border-radius: 50px; -} - -.logo { - background: url(../images/sf-ux-logo.svg); - height: 30px; - width: 161px; -} - -.logo-white { - background: url(../images/sf-ux-logo-white.svg); - height: 30px; - width: 161px; -} - -.arrow { - background: url(../images/arrow.png); - width: 100%; - height: 36px; - background-size: contain; - background-repeat: no-repeat; - background-position: center; -} - -.arrow-2 { - background: url(../images/arrow-2.png); - width: 100%; - height: 66px; - background-size: contain; - background-repeat: no-repeat; - background-position: right; -} \ No newline at end of file diff --git a/ux.symfony.com/assets/styles/_live_demos.scss b/ux.symfony.com/assets/styles/_live_demos.scss deleted file mode 100644 index 3cd437a1307..00000000000 --- a/ux.symfony.com/assets/styles/_live_demos.scss +++ /dev/null @@ -1,3 +0,0 @@ -.form-no-mb .mb-3 { - margin-bottom: 0 !important; -} diff --git a/ux.symfony.com/assets/styles/_navigation.scss b/ux.symfony.com/assets/styles/_navigation.scss deleted file mode 100644 index e8cff17a514..00000000000 --- a/ux.symfony.com/assets/styles/_navigation.scss +++ /dev/null @@ -1,18 +0,0 @@ -.nav-tabs { - border-bottom: 1px solid $n-900; -} - -.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { - color: #fff; - background-color: $n-800; - border-color: $n-800; -} - -.nav-link { - color: #fff; -} - -.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus { - border-color: $n-800; - color: $n-100; -} \ No newline at end of file diff --git a/ux.symfony.com/assets/styles/_terminal.scss b/ux.symfony.com/assets/styles/_terminal.scss deleted file mode 100644 index 147f7793b2a..00000000000 --- a/ux.symfony.com/assets/styles/_terminal.scss +++ /dev/null @@ -1,102 +0,0 @@ -.terminal-wrapper { - background-color: $n-900; - border-radius: 12px; - position: relative; - padding: 30px 0 0 0; -} - -.terminal-code { - background-color: $n-900; - border-radius: 12px; - padding: 0; - color: #fff; - font-size: 12px; -} - -.terminal-code.terminal-code-no-filename { - padding-top: 0; -} -.terminal-code a.filename-header { - color: white; - display: inline-block; - flex-shrink: 1; - overflow: hidden; - text-overflow: ellipsis; -} - -.terminal-wrapper .terminal-controls { - position: absolute; - top: 8px; - left: 12px; - display: flex; - align-items: center; - gap: .5rem; -} -.terminal-wrapper .terminal-controls span { - display: inline-block; - width: .75rem; - height: .75rem; - border-radius: 50%; -} - -.red { - background: $red; -} - -.yellow { - background: $yellow; -} - -.green { - background: $green; -} - -.terminal-body { - background-color: $n-800; - height: 100%; - font-family: 'Space Mono', monospace; - font-size: 14px; - line-height: 160%; - color: #FFF; - border-radius: 0px 0px 12px 12px; -} -.terminal-code .btn-copy, .terminal-code .btn-copy:active { - background-color: $n-700; - color: $n-200; -} -.terminal-code .btn-copy:hover { - background-color: $n-600; -} -.terminal-code .code-buttons { - white-space: nowrap; -} -/* copy button inside the code block itself */ -.terminal-code .terminal-body .code-buttons { - position: absolute; - top: .5em; - right: .5em; -} -.terminal-code .btn-link { - color: $n-200; -} -.terminal-code .btn-link:hover { - color: $n-100; -} -.terminal-code.terminal-code-no-filename .terminal-body { - border-radius: 12px; -} -/* for tabbed terminal blocks */ -.terminal-code .terminal-code.terminal-code-no-filename .terminal-body { - border-top-right-radius: 0; - border-top-left-radius: 0; -} - -:not(.terminal-wrapper) .terminal-body { - margin: 0; - border-radius: 6px; - padding: 12px; -} - -.homepage-terminal-swapper pre { - margin-bottom: 0; -} diff --git a/ux.symfony.com/assets/styles/_type.scss b/ux.symfony.com/assets/styles/_type.scss deleted file mode 100644 index 45df8168eb2..00000000000 --- a/ux.symfony.com/assets/styles/_type.scss +++ /dev/null @@ -1,231 +0,0 @@ -.ubuntu { - font-family: Ubuntu; -} -.playfair { - font-family: Playfair Display; -} - -h1 { - font-size: 52px; - font-weight: 700; - letter-spacing: -0.035em; -} - -h1.inter { - font-family: Inter; - font-size: 16px; - font-weight: 700; - line-height: 26px; - letter-spacing: 0px; -} - -h1.ubuntu { - line-height: 60px; -} - -h1 .playfair { - font-style: italic; - line-height: 70px; -} - -h2.ubuntu { - font-size: 42px; - font-weight: 700; - line-height: 48px; - letter-spacing: -2px; -} - -h2.playfair { - font-size: 38px; - font-style: italic; - font-weight: 700; - line-height: 51px; - letter-spacing: -2px; -} - - -h3, a.component-title { - font-family: Ubuntu; - font-size: 28px !important; - font-weight: 700!important; - line-height: 32px !important; - letter-spacing: -1px; - color: #0A0A0A; - text-decoration: none; -} - -h4.ubuntu { - font-size: 16px; - font-weight: 700; - line-height: 18.38px; -} - -.component-headlines { - width: 50%; -} - -@media (max-width: 900px) { - .component-headlines { - width: 56%; - } -} - -@media (max-width: 767px) { - .component-headlines { - text-align: center; - width: 100% - } -} - -.hero-sub-text { - width: 35%; -} - -@media (max-width: 1114px) { - .hero-sub-text { - width: 60%; - } -} - - -@media (max-width: 734px) { - .hero-sub-text { - width: 80%; - } -} - -.ubuntu-header { - font-family: Ubuntu; - font-size: 24px; - font-weight: 700; - line-height: 24px; - letter-spacing: -1px; - text-decoration: none; -} - -.ubuntu-title { - font-family: Ubuntu; - font-size: 19px; - font-weight: 700; - line-height: 22px; - letter-spacing: -0.668767511844635px; -} - -.eyebrows { - text-transform: uppercase; - font-family: Inter; - font-size: 0.7rem; - font-weight: 600; - line-height: 1.6; - letter-spacing: 0.125rem; -} - -.info-tooltips { - font-family: Inter; - font-size: 12px; - font-weight: 400; - line-height: 19px; - letter-spacing: 0px; -} - -.font-white { - color: #fff; -} - -.font-white a:hover { - color: $n-100; -} - -.font-purple{ - color: #6A2DBA; -} - -.text-underline { - text-decoration: underline; -} - -.text-bold { - font-weight: 700; -} - -@media (max-width: 576px) { - h1.ubuntu { - font-size: 36px; - line-height: 41px; - letter-spacing: -1px; - } - - h1.playfair { - font-size: 36px; - line-height: 48px; - letter-spacing: -1px; - } - - h2.ubuntu { - font-size: 28px; - line-height: 32px; - letter-spacing: -1px; - } - - h2.playfair { - font-size: 28px; - line-height: 37px; - letter-spacing: -1px; - } - - - h3, a.component-title { - font-size: 22px; - line-height: 25px; - letter-spacing: -1px; - } -} - -.logo { - font-family: 'EB Garamond', serif;font-family: ITC Garamond Std; - font-size: 28px; - font-style: italic; - font-weight: 700; - line-height: 34px; - letter-spacing: -1.1817766427993774px; -} - -.nav-options { - font-family: Ubuntu; - font-size: 15px; - font-weight: 700; - line-height: 20px; - letter-spacing: 0px; -} - -.nav-options-icon { - font-size: 20px; - } - -.hero { - background: linear-gradient(113.84deg, #D65831 0%, #D2D631 36.52%, #31D673 71.83%, #315FD6 100%); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; -} - -.component-arrow { - color: $n-200; -} - -.icon-testimonial { - font-size: 22px; -} - -.components-link:hover { - box-shadow: 2px 3px 9px 4px rgb(0 0 0 / 12%); -} - -.form-control::placeholder { - color: $n-300; - font-weight: lighter; -} - -blockquote { - border-left: 5px solid $n-200; - padding-left: 1rem; -} diff --git a/ux.symfony.com/assets/styles/_variables.scss b/ux.symfony.com/assets/styles/_variables.scss index 92605bcce51..89bb8e3fa82 100644 --- a/ux.symfony.com/assets/styles/_variables.scss +++ b/ux.symfony.com/assets/styles/_variables.scss @@ -13,22 +13,6 @@ $red: #FB4040; $yellow: #FBC640; $green: #84DE2C; +$primary: #222 !default; - - -@at-root :root { - - // Borders - --border-radius-small: .5rem; - --border-radius: 1rem; - --border-radius-large: 1.5rem; - --border-color: #{$n-100}; - - // Spaces - --space-smaller: .5rem; - --space-small: .75rem; - --space-regular: 1rem; - --space-large: 1.5rem; - --space-larger: 2rem; - -} +$size-unit: calc(8px + 1.5625vw); diff --git a/ux.symfony.com/assets/styles/app.scss b/ux.symfony.com/assets/styles/app.scss index f0582e15732..7f6aef01555 100644 --- a/ux.symfony.com/assets/styles/app.scss +++ b/ux.symfony.com/assets/styles/app.scss @@ -1,73 +1,99 @@ -@import './variables'; -@import '../../vendor/twbs/bootstrap/scss/bootstrap'; +// Bootstrap foundation +@import "../../vendor/twbs/bootstrap/scss/functions"; -@import './container'; -@import './navigation'; -@import './images'; -@import './type'; -@import './terminal'; -@import './highlight'; -@import './live_demos'; +// Default variable overrides +@import "variables"; -@import './components/Icon'; -@import './components/PackageBox'; +// $enable-cssgrid: true +// $enable-grid-classes: true; -body { - font-family: Inter; - font-size: 16px; - font-weight: 400; - line-height: 26px; - letter-spacing: 0px; - color: #0A0A0A; -} +// Bootstrap variables +@import "../../vendor/twbs/bootstrap/scss/variables"; +@import "../../vendor/twbs/bootstrap/scss/variables-dark"; -a, a.page-link, a.page-link:hover { - text-decoration: none; - color: #0A0A0A; -} +// Boostrap remainder of required parts +@import "../../vendor/twbs/bootstrap/scss/maps"; +@import "../../vendor/twbs/bootstrap/scss/mixins"; +@import "../../vendor/twbs/bootstrap/scss/utilities"; +@import "../../vendor/twbs/bootstrap/scss/root"; +// Layout & components +@import "../../vendor/twbs/bootstrap/scss/reboot"; +@import "../../vendor/twbs/bootstrap/scss/type"; +@import "../../vendor/twbs/bootstrap/scss/images"; +@import "../../vendor/twbs/bootstrap/scss/containers"; +@import "../../vendor/twbs/bootstrap/scss/grid"; +@import "../../vendor/twbs/bootstrap/scss/tables"; +@import "../../vendor/twbs/bootstrap/scss/forms"; +@import "../../vendor/twbs/bootstrap/scss/buttons"; +@import "../../vendor/twbs/bootstrap/scss/transitions"; +@import "../../vendor/twbs/bootstrap/scss/dropdown"; +// @import "../../vendor/twbs/bootstrap/scss/button-group"; +@import "../../vendor/twbs/bootstrap/scss/nav"; +@import "../../vendor/twbs/bootstrap/scss/navbar"; +@import "../../vendor/twbs/bootstrap/scss/card"; +// @import "../../vendor/twbs/bootstrap/scss/accordion"; +// @import "../../vendor/twbs/bootstrap/scss/breadcrumb"; +@import "../../vendor/twbs/bootstrap/scss/pagination"; +@import "../../vendor/twbs/bootstrap/scss/badge"; +@import "../../vendor/twbs/bootstrap/scss/alert"; +// @import "../../vendor/twbs/bootstrap/scss/progress"; +// @import "../../vendor/twbs/bootstrap/scss/list-group"; +@import "../../vendor/twbs/bootstrap/scss/close"; +// @import "../../vendor/twbs/bootstrap/scss/toasts"; +@import "../../vendor/twbs/bootstrap/scss/modal"; +@import "../../vendor/twbs/bootstrap/scss/tooltip"; +// @import "../../vendor/twbs/bootstrap/scss/popover"; +// @import "../../vendor/twbs/bootstrap/scss/carousel"; +// @import "../../vendor/twbs/bootstrap/scss/spinners"; +// @import "../../vendor/twbs/bootstrap/scss/offcanvas"; +// @import "../../vendor/twbs/bootstrap/scss/placeholders"; +// Helpers +@import "../../vendor/twbs/bootstrap/scss/helpers"; +// Utilities +@import "../../vendor/twbs/bootstrap/scss/utilities/api"; -.navbar-toggler:focus { - box-shadow: none; -} +// Base +@import "app/html"; +@import "app/root"; +@import "app/typography"; -.dropdown button { - border: none; - background: none; - display: block; -} -.nav-white-mode .nav-options, i.nav-white-mode { - color: #fff; -} +// Layouts +@import "layouts/grid"; -footer { - height: 100px; -} +// Components +@import "components/demo-container"; +@import "components/DocsLink"; +@import "components/file_tree"; +@import "components/Icon"; +@import "components/PackageHeader"; +@import "components/PackageBox"; +@import "components/Terminal"; +@import "components/TerminalCommand"; +@import "components/ThemeSwitcher"; -.hero-background { - background: url(../images/background_homepage.png); -} +// Utilities +@import "utilities/arrow"; +@import "utilities/background"; +@import "utilities/info-tooltips"; +@import "utilities/font"; +@import "utilities/shadow"; +@import "utilities/text"; -#cropper-preview { - overflow: hidden; - width: 200px; - height: 200px; -} +// Vendors customization +@import "vendor/bootstrap"; +@import "vendor/highlight"; +@import "vendor/tom-select"; -.alert-right-message { - position: absolute; - top: 0; - right: 0; - z-index: 2; - padding: 1.25rem 1rem; - font-size: .8rem; -} +// Sections +@import "sections/header"; +@import "sections/nav"; +@import "sections/hero"; -.page-item.active .page-link { - background-color: $n-700; - border-color: $n-700; -} +@import "./container"; +@import "./images"; +// TODO move Terminal/CodeBlock .btn-expand-code { position: absolute; bottom: 0; diff --git a/ux.symfony.com/assets/styles/app/_html.scss b/ux.symfony.com/assets/styles/app/_html.scss new file mode 100644 index 00000000000..25efe51e91d --- /dev/null +++ b/ux.symfony.com/assets/styles/app/_html.scss @@ -0,0 +1,37 @@ +body { + font-family: Inter; + font-size: 16px; + font-weight: 400; + line-height: 26px; + + // Dark Mode + transition: background-color 150ms linear; +} + +a, a.page-link, a.page-link:hover { + text-decoration: none; + color: var(--color-primary); +} + +::selection { + color: var(--bs-body-bg); + background-color: var(--bs-body-color); + -webkit-text-fill-color: currentColor; +} + +.App { + align-items: stretch; + flex-direction: column; + display: flex; + min-height: 100vh; + min-width: 320px; + overflow-x: clip; +} +main { + flex-grow: 1; +} +header, +main, +footer { + flex-shrink: 0; +} diff --git a/ux.symfony.com/assets/styles/app/_root.scss b/ux.symfony.com/assets/styles/app/_root.scss new file mode 100644 index 00000000000..47f82457d52 --- /dev/null +++ b/ux.symfony.com/assets/styles/app/_root.scss @@ -0,0 +1,25 @@ +@at-root :root { + + // Borders + --border-radius-small: .5rem; + --border-radius: 1rem; + --border-radius-large: 1.5rem; + --border-color: #{$n-100}; + + // Spaces + --space-smaller: .5rem; + --space-small: .75rem; + --space-regular: 1rem; + --space-large: 1.5rem; + --space-larger: 2rem; + + // Fonts + // --font-family-title: "Inter"; + --font-family-text: "Inter"; + // --font-family-code: "Inter"; + + // Colors + --color-primary: var(--bs-body-color); + --color-secondary: var(--bs-secondary-color); + --color-tertiary: var(--bs-tertiary-color); +} diff --git a/ux.symfony.com/assets/styles/app/_typography.scss b/ux.symfony.com/assets/styles/app/_typography.scss new file mode 100644 index 00000000000..98240f7a4eb --- /dev/null +++ b/ux.symfony.com/assets/styles/app/_typography.scss @@ -0,0 +1,130 @@ + +h1 { + font-size: 52px; + font-weight: 700; + letter-spacing: -0.035em; +} + +h1.inter { + font-family: Inter; + font-size: 16px; + font-weight: 700; + line-height: 26px; + letter-spacing: 0px; +} + +h1.ubuntu { + line-height: 60px; +} + +h1 .playfair { + font-style: italic; + line-height: 70px; +} + +h2.ubuntu { + font-size: 42px; + font-weight: 700; + line-height: 48px; + letter-spacing: -2px; +} + +h2.playfair { + font-size: 38px; + font-style: italic; + font-weight: 700; + line-height: 51px; + letter-spacing: -2px; +} + +h3, a.component-title { + font-family: Ubuntu; + font-size: 28px !important; + font-weight: 700 !important; + line-height: 32px !important; + letter-spacing: -1px; + color: #0A0A0A; + text-decoration: none; +} + +h4.ubuntu { + font-size: 16px; + font-weight: 700; + line-height: 18.38px; +} + +.component-headlines { + width: 50%; +} + +@media (max-width: 900px) { + .component-headlines { + width: 56%; + } +} + +@media (max-width: 767px) { + .component-headlines { + text-align: center; + width: 100% + } +} + +.ubuntu-header { + font-family: Ubuntu; + font-size: 24px; + font-weight: 700; + line-height: 24px; + letter-spacing: -1px; + text-decoration: none; +} + +.ubuntu-title { + font-family: Ubuntu; + font-size: 19px; + font-weight: 700; + line-height: 22px; + letter-spacing: -0.668767511844635px; +} + +.eyebrows { + text-transform: uppercase; + font-family: Inter; + font-size: 0.7rem; + font-weight: 600; + line-height: 1.6; + letter-spacing: 0.125rem; +} + + +@media (max-width: 576px) { + h1.ubuntu { + font-size: 36px; + line-height: 41px; + letter-spacing: -1px; + } + + h1.playfair { + font-size: 36px; + line-height: 48px; + letter-spacing: -1px; + } + + h2.ubuntu { + font-size: 28px; + line-height: 32px; + letter-spacing: -1px; + } + + h2.playfair { + font-size: 28px; + line-height: 37px; + letter-spacing: -1px; + } + + h3, a.component-title { + font-size: 22px; + line-height: 25px; + letter-spacing: -1px; + } +} diff --git a/ux.symfony.com/assets/styles/components/_DocsLink.scss b/ux.symfony.com/assets/styles/components/_DocsLink.scss new file mode 100644 index 00000000000..e4de46e5035 --- /dev/null +++ b/ux.symfony.com/assets/styles/components/_DocsLink.scss @@ -0,0 +1,62 @@ +.DocsLink { + border: 1px solid var(--bs-secondary-border-subtle); + border-radius: var(--border-radius, 1rem); + display: flex; + gap: var(--space-large, 1rem); + padding: var(--space-large, 1rem); + position: relative; + place-self: stretch; + background: var(--bs-body-bg, var(--bs-secondary-border-subtle)); + opacity: .9; + transition: opacity 250ms ease-in-out, transform 250ms ease-in-out; + + &:hover { + transform: translateY(-.25rem); + opacity: 1; + } + +} +.DocsLink_content { + display: flex; + flex-direction: column; + justify-content: center; + flex: 1 1 auto; +} + +.DocsLink_title { + display: flex; + flex-direction: row; + align-items: center; + gap: .75rem; +} + +.DocsLink_link { + &:after { + content: ''; + position: absolute; + inset: 0 0; + z-index: 40; + } +} + +.DocsLink_arrow { + color: gray; + font-size: 1.5rem; + opacity: .5; + transition: opacity 600ms ease-in-out; + .DocsLink:hover & { + transition: opacity 250ms ease-in-out; + opacity: 1; + } +} + +.DocsLink_description { + p { + line-height: 1.4; + } + :last-child { + margin-bottom: 0; + } +} + + diff --git a/ux.symfony.com/assets/styles/components/_PackageBox.scss b/ux.symfony.com/assets/styles/components/_PackageBox.scss index 2a7e304525b..1b3f3217177 100644 --- a/ux.symfony.com/assets/styles/components/_PackageBox.scss +++ b/ux.symfony.com/assets/styles/components/_PackageBox.scss @@ -1,14 +1,17 @@ .PackageBox { + --gradient: #000; + --color: #000; --space-large: 1.5rem; + --bg-color: var(--bs-body-bg); - border: 1px solid var(--border-color); + border: 1px solid var(--bs-secondary-bg); border-radius: var(--border-radius); display: flex; gap: var(--space-large); padding: var(--space-large); position: relative; place-self: stretch; - background: rgba(255, 255, 255, .98); + background: var(--bg-color); transition: border-color 750ms ease-in-out, transform 750ms ease-in-out; @@ -17,7 +20,6 @@ transition: border-color 200ms ease-in-out, transform 200ms ease-in-out; - border-color: rgba(230, 222, 222, 0.8); transform: translateY(-.25rem); } } @@ -30,7 +32,7 @@ opacity: 0; filter: blur(.75rem); transform: translateZ(-1em); - background: var(--gradient); + background: var(--gradient), var(--color); transition: opacity 600ms ease-in-out; z-index: -1; } @@ -44,7 +46,7 @@ content: ""; position: absolute; inset: 0 0; - background: #fff; + background: var(--bg-color); border-radius: var(--border-radius); z-index: -1; transition: opacity 600ms ease-in-out; @@ -56,11 +58,11 @@ z-index: -1; } - .PackageBox_logo { --logo-size: 6rem; background: var(--gradient); + background-color: var(--color); width: var(--logo-size); height: var(--logo-size); border-radius: var(--border-radius-large); @@ -69,6 +71,10 @@ justify-content: center; flex-shrink: 0; + [data-bs-theme="dark"] & { + background-blend-mode: darken; + } + img { width: calc(0.4 * var(--logo-size)); height: auto; @@ -84,7 +90,13 @@ filter 250ms ease-in-out, transform 250ms ease-in-out; } + } + @media screen and (max-width: 960px) { + --logo-size: 5rem; + } + @media screen and (max-width: 740px) { + --logo-size: 4rem; } } @@ -131,3 +143,5 @@ margin-bottom: 0; } } + + diff --git a/ux.symfony.com/assets/styles/components/_PackageHeader.scss b/ux.symfony.com/assets/styles/components/_PackageHeader.scss new file mode 100644 index 00000000000..df0e1bfef32 --- /dev/null +++ b/ux.symfony.com/assets/styles/components/_PackageHeader.scss @@ -0,0 +1,27 @@ +.PackageHeader { + h1 { + text-shadow: 0 .25rem .25rem rgba(0, 0, 0, .05); + } + + .AppHeader + * & { + padding-top: 3rem; + } + + [data-bs-theme="dark"] & { + background-blend-mode: hue !important; + // background-blend-mode: soft-light; + } + + .nav-options { + font-family: Ubuntu; + font-size: 15px; + font-weight: 700; + line-height: 20px; + letter-spacing: 0px; + color: #fff; + } + + .nav-options-icon { + font-size: 20px; + } +} diff --git a/ux.symfony.com/assets/styles/components/_Terminal.scss b/ux.symfony.com/assets/styles/components/_Terminal.scss new file mode 100644 index 00000000000..190f7a071d6 --- /dev/null +++ b/ux.symfony.com/assets/styles/components/_Terminal.scss @@ -0,0 +1,139 @@ +.Terminal { + --border-radius: .75rem; + + background-color: $n-900; + border-radius: .75rem; + position: relative; + font-size: 12px; +} + +.Terminal_header { + display: flex; + background-color: $n-900; + border-top-left-radius: var(--border-radius); + border-top-right-radius: var(--border-radius); + align-items: center; + justify-content: space-between; + padding: .5rem; + + .nav-tabs { + border: 0; + } + .nav-tabs .nav-link, + .nav-tabs .nav-item { + border: 0; + } + .nav-link { + border-bottom: 0; + margin-bottom: 0; + color: inherit; + color: $n-100; + } + .nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { + background-color: $n-800; + border-color: $n-800; + color: $n-100; + } + .nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus { + border-color: $n-800; + color: $n-100; + } +} + +.Terminal_title { + color: #fff; + display: inline-block; + flex-shrink: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-inline-start: .25rem; +} + +.Terminal_controls { + align-items: center; + gap: 0.5rem; + display: flex; + padding: .25rem 0.5rem; +} +.Terminal_controls span { + display: inline-block; + width: .75rem; + height: .75rem; + border-radius: 50%; + + &.red { + background: $red; + } + &.yellow { + background: $yellow; + } + &.green { + background: $green; + } +} + +.Terminal_body { + background-color: $n-800; + height: 100%; + font-family: 'Space Mono', monospace; + font-size: 14px; + line-height: 160%; + color: #FFF; + border-radius: .75rem; + border: 1px solid var(--bs-body-color); + position: relative; + + [data-bs-theme="dark"] & { + border: 1px solid var(--bs-secondary-bg-subtle); + } +} + +.Terminal_header + .Terminal_body, +.Terminal .Terminal .Terminal_body { + border-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.Terminal_actions { + .btn-link { + color: $n-200; + background: none; + } + + .btn-copy { + background-color: $n-700; + color: $n-200; + &:active { + background-color: $n-700; + color: $n-200; + } + &:hover { + background-color: $n-600; + } + } + .btn-link:hover { + color: $n-100; + } + white-space: nowrap; +} + +/* copy button inside the code block itself */ +.Terminal_body .Terminal_actions { + position: absolute; + right: .5rem; + top: .5rem; +} + +.Terminal_body { + overflow-inline: auto; +} +.Terminal_body pre { + padding: 1rem; + margin: 0; +} + +.Terminal_content { + font-size: .9rem; +} diff --git a/ux.symfony.com/assets/styles/components/_TerminalCommand.scss b/ux.symfony.com/assets/styles/components/_TerminalCommand.scss new file mode 100644 index 00000000000..41e2d0be4db --- /dev/null +++ b/ux.symfony.com/assets/styles/components/_TerminalCommand.scss @@ -0,0 +1,57 @@ +.TerminalCommand { + --color-background: var(--bs-black); + --color-text: var(--bs-white); + --color-accent: var(--bs-blue); + + display: flex; + padding: .5rem; + gap: .5rem; + border-radius: .5rem; + flex-direction: row; + position: relative; + color: var(--color-fq); + overflow: clip; + z-index: 1; + max-inline-size: 100%; + max-width: 100%; + + &::before { + content: ''; + inset: 0 0; + background: var(--color-background); + opacity: .9; + backdrop-filter: blur(5px); + position: absolute; + z-index: -1; + display: block; + } +} + +.TerminalCommand_input { + color: var(--color-text); + border: 0!important; + border: none; + background: transparent; + z-index: 4; + outline: none; + font-family: var(--bs-font-monospace); + font-size: .9rem; + padding: 0 .5rem; + width: inherit; + overflow: scroll; +} + +.TerminalCommand_action { + background: var(--color-accent); + color: var(--color-text); + border: 0 !important; + z-index: 4; + opacity: .9; + &:hover { + background: var(--color-accent); + color: var(--color-text); + opacity: 1; + } +} + + diff --git a/ux.symfony.com/assets/styles/components/_ThemeSwitcher.scss b/ux.symfony.com/assets/styles/components/_ThemeSwitcher.scss new file mode 100644 index 00000000000..ea4a991b453 --- /dev/null +++ b/ux.symfony.com/assets/styles/components/_ThemeSwitcher.scss @@ -0,0 +1,40 @@ +.ThemeSwitcher { + --mod-light: 1; + --mod-dark: 0; + + [data-bs-theme="dark"] & { + --mod-light: 0; + --mod-dark: 1; + } + + position: relative; + display: inline-flex; + background: none; + border: none; + height: 1em; + width: 1em; + color: var(--bs-body-color); + + .Icon { + position: absolute; + border: none; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + color: inherit; + transition: opacity 250ms ease-in-out, + scale 250ms linear; + } + + .Icon--theme-light { + opacity: calc(var(--mod-light)); + scale: calc(var(--mod-light)); + } + + .Icon--theme-dark { + opacity: calc(var(--mod-dark)); + scale: calc(var(--mod-dark)); + } +} + + diff --git a/ux.symfony.com/assets/styles/components/_demo-container.scss b/ux.symfony.com/assets/styles/components/_demo-container.scss new file mode 100644 index 00000000000..b17936b0523 --- /dev/null +++ b/ux.symfony.com/assets/styles/components/_demo-container.scss @@ -0,0 +1,27 @@ +.demo-container { + background-color: var(--bs-body-bg); + border: 1px solid var(--bs-secondary-bg-subtle); + border-top-left-radius: 12px; + border-top-right-radius: 12px; +} + +.demo-container-inner { + background-color: var(--bs-secondary-bg); + border: 1px solid var(--bs-secondary-bg-subtle); + border-top: transparent; + border-bottom-left-radius: 12px; + border-bottom-right-radius: 12px; +} + +.demo-container-inner-secondary { + background-color: var(--bs-secondary-bg); + border: 1px solid var(--bs-secondary-bg-subtle); + border-top: transparent; + border-bottom-left-radius: 12px; + border-bottom-right-radius: 12px; +} + +.demo-chat > .demo-container-inner { + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +} diff --git a/ux.symfony.com/assets/styles/components/_file_tree.scss b/ux.symfony.com/assets/styles/components/_file_tree.scss new file mode 100644 index 00000000000..f9b86f8ddee --- /dev/null +++ b/ux.symfony.com/assets/styles/components/_file_tree.scss @@ -0,0 +1,47 @@ +.file-tree ul { + display: flex; + flex-direction: column; + align-items: stretch; + justify-content: flex-start; +} + +.file-tree li > span { + display: flex; + flex-direction: row; + gap: 1rem; +} + +.file-tree-main::before { + background: none !important; +} + +.file-tree ul { + position: relative; + padding-inline-start: 1rem; +} + +.file-tree .tooltip-inner { + max-width: 350px; +} + +.file-tree.nodots ul :not(span) { + margin-left: 12px; +} + +.file-tree ul::before { + content: ''; + width: 1rem; + background: url(../images/dot.svg) left top / 2px 2px; + display: block; + position: absolute; +} + +.file-tree ul::before { + top: 0; + height: 100%; + background-repeat: repeat-y; + background-position: center; + left: 0; + z-index: -1; +} + diff --git a/ux.symfony.com/assets/styles/layouts/_grid.scss b/ux.symfony.com/assets/styles/layouts/_grid.scss new file mode 100644 index 00000000000..753356aca14 --- /dev/null +++ b/ux.symfony.com/assets/styles/layouts/_grid.scss @@ -0,0 +1,9 @@ +.grid { + --rows: 1; + --columns: 1; + --gap: 1rem; + display: grid; + grid-template-rows: repeat(var(--rows), 1fr); + grid-template-columns: repeat(var(--columns), 1fr); + gap: var(--gap); +} diff --git a/ux.symfony.com/assets/styles/sections/_header.scss b/ux.symfony.com/assets/styles/sections/_header.scss new file mode 100644 index 00000000000..fb9c275edbc --- /dev/null +++ b/ux.symfony.com/assets/styles/sections/_header.scss @@ -0,0 +1,49 @@ +.AppHeader { + position: absolute; + top: 1rem; // TODO responsive + left: 0; + right: 0; + z-index: 2; + + @media (min-width: 576px) { + top: 2rem; + } + @media (min-width: 768px) { + top: 3rem; + } +} + +.AppHeader { + --text-color: var(--bs-body-color); + color: var(--text-color); +} +.AppHeader--white { + --text-color: #fff; +} + +.AppHeader_logo { + --height: 2rem; + height: var(--height); + width: calc(161 / 30 * var(--height)); + background: url(../images/sf-ux.svg); + background-size: 100%; + + transition: filter 250ms ease-in; + + span { + display: none; + } + + .AppHeader--white &, + [data-bs-theme="dark"] & { + filter: invert(1); + } +} + +.AppHeader_toggler:focus { + box-shadow: none; +} + +.AppHeader_toggler { + color: currentColor; +} diff --git a/ux.symfony.com/assets/styles/sections/_hero.scss b/ux.symfony.com/assets/styles/sections/_hero.scss new file mode 100644 index 00000000000..a8b16900545 --- /dev/null +++ b/ux.symfony.com/assets/styles/sections/_hero.scss @@ -0,0 +1,48 @@ +.hero { + padding-top: 5rem; +} + +.rainbow-emphasis { + background: linear-gradient(113.84deg, #D65831 0%, #D2D631 36.52%, #31D673 71.83%, #315FD6 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + font-style: normal; +} + +.hero-background { + background: url(../images/background_homepage.png); + background-size: cover; + padding-block-start: 4rem; + + &::after { + content: ""; + display: block; + position: absolute; + background: #d75b5b00; + width: 100%; + margin-block-start: -1.5rem; + backdrop-filter: blur(1rem); + height: 3rem; + } +} + +.hero-sub-text { + width: 35%; +} + +@media (max-width: 1114px) { + .hero-sub-text { + width: 60%; + } +} + +@media (max-width: 734px) { + .hero-sub-text { + width: 80%; + } +} + +.hero-terminal { + transform: translateY(50%); +} + diff --git a/ux.symfony.com/assets/styles/sections/_nav.scss b/ux.symfony.com/assets/styles/sections/_nav.scss new file mode 100644 index 00000000000..3648187263f --- /dev/null +++ b/ux.symfony.com/assets/styles/sections/_nav.scss @@ -0,0 +1,66 @@ +.AppNav { + color: inherit; +} + +.AppNav_menu { + gap: 2rem; + justify-content: flex-end; + line-height: 2rem; + + @media (max-width: 575px) { + display: flex; + flex-direction: row; + height: 3rem; + place-content: center; + .Icon--chevron-down { + display: none; + } + } +} + +.AppNav_item { + color: inherit; + font-family: "Ubuntu"; + font-size: 1rem; + font-weight: 700; + letter-spacing: 0; + opacity: .85; + transition: opacity 250ms; + padding: 0; + border: none; + background: none; + line-height: 2rem; + &:hover { + opacity: 1; + } +} + +.AppNav_item--icon { + padding: 0; + width: 1.5rem; + height: 1.5rem; + display: grid; + place-content: center; + + > .Icon { + font-size: 1.25rem; + } +} + +.AppNav_separator { + display: flex; + color: inherit; + width: 2px; + border-radius: 1px; + height: 1rem; + margin: 0; + border-left: 1px dashed var(--text-color); + opacity: .5; + display: none; // TODO remove if ok +} + +.nav-component-img { + height: 22px; + width: 22px; + border-radius: 4px; +} diff --git a/ux.symfony.com/assets/styles/utilities/_arrow.scss b/ux.symfony.com/assets/styles/utilities/_arrow.scss new file mode 100644 index 00000000000..50a4ed6b030 --- /dev/null +++ b/ux.symfony.com/assets/styles/utilities/_arrow.scss @@ -0,0 +1,31 @@ +.component-arrow { + color: $n-200; +} + +.arrow { + background: url(../images/arrow.png); + width: 100%; + height: 36px; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + + [data-bs-theme="dark"] & { + filter: invert(100); + opacity: .75; + } +} + +.arrow-2 { + background: url(../images/arrow-2.png); + width: 100%; + height: 66px; + background-size: contain; + background-repeat: no-repeat; + background-position: right; + + [data-bs-theme="dark"] & { + filter: invert(100); + opacity: .75; + } +} diff --git a/ux.symfony.com/assets/styles/utilities/_background.scss b/ux.symfony.com/assets/styles/utilities/_background.scss new file mode 100644 index 00000000000..6f2b6ebd286 --- /dev/null +++ b/ux.symfony.com/assets/styles/utilities/_background.scss @@ -0,0 +1,9 @@ +.background-glass { + --glass-opacity: .75; + --glass-color: 255 255 255; + background: rgba(var(--glass-color) / var(--glass-opacity)); + + [data-bs-theme="dark"] & { + --glass-color: 0 0 0; + } +} diff --git a/ux.symfony.com/assets/styles/utilities/_font.scss b/ux.symfony.com/assets/styles/utilities/_font.scss new file mode 100644 index 00000000000..48ceb52d905 --- /dev/null +++ b/ux.symfony.com/assets/styles/utilities/_font.scss @@ -0,0 +1,19 @@ +.ubuntu { + font-family: Ubuntu; +} + +.playfair { + font-family: Playfair Display; +} + +.font-title { + font-family: var(--font-family-title); +} + +.font-text { + font-family: var(--font-family-text); +} + +.font-code { + font-family: var(--font-family-code); +} diff --git a/ux.symfony.com/assets/styles/utilities/_info-tooltips.scss b/ux.symfony.com/assets/styles/utilities/_info-tooltips.scss new file mode 100644 index 00000000000..2a14072eefd --- /dev/null +++ b/ux.symfony.com/assets/styles/utilities/_info-tooltips.scss @@ -0,0 +1,7 @@ +.info-tooltips { + font-family: Inter; + font-size: 12px; + font-weight: 400; + line-height: 19px; + letter-spacing: 0px; +} diff --git a/ux.symfony.com/assets/styles/utilities/_shadow.scss b/ux.symfony.com/assets/styles/utilities/_shadow.scss new file mode 100644 index 00000000000..ba59c4fdc1d --- /dev/null +++ b/ux.symfony.com/assets/styles/utilities/_shadow.scss @@ -0,0 +1,17 @@ +.shadow-blur { + position: relative; + &:after { + position: absolute; + content: ""; + z-index: -1; + background: var(--gradient); + inset: 3rem; + border-radius: 3rem; + bottom: var(--shadow-bottom, 0); + filter: blur(3rem); + } +} + +.shadow-blur--rainbow { + --gradient: linear-gradient(113.84deg, #D65831 0%, #D2D631 36.52%, #31D673 71.83%, #3aa3ff 100%); +} diff --git a/ux.symfony.com/assets/styles/utilities/_text.scss b/ux.symfony.com/assets/styles/utilities/_text.scss new file mode 100644 index 00000000000..1e843f21a49 --- /dev/null +++ b/ux.symfony.com/assets/styles/utilities/_text.scss @@ -0,0 +1,19 @@ +.font-white { + color: #fff; +} + +.font-white a:hover { + color: $n-100; +} + +.font-purple { + color: #6A2DBA; +} + +.text-underline { + text-decoration: underline; +} + +.text-bold { + font-weight: 700; +} diff --git a/ux.symfony.com/assets/styles/vendor/_bootstrap.scss b/ux.symfony.com/assets/styles/vendor/_bootstrap.scss new file mode 100644 index 00000000000..483ae841427 --- /dev/null +++ b/ux.symfony.com/assets/styles/vendor/_bootstrap.scss @@ -0,0 +1,48 @@ +.alert-right-message { + position: absolute; + top: 0; + right: 0; + z-index: 2; + padding: 1.25rem 1rem; + font-size: .8rem; +} + +.form-control::placeholder { + color: $n-300; + font-weight: lighter; +} + +.btn-outline-primary { + opacity: .75; + &:hover { + opacity: 1; + } + + [data-bs-theme="dark"] & { + --color: var(--bs-body-color); + + --bs-btn-color: var(--color); + --bs-btn-border-color: var(--color); + --bs-btn-hover-color: var(--bs-body-bg); + --bs-btn-hover-bg: var(--color); + --bs-btn-hover-border-color: var(--color); + --bs-btn-focus-shadow-rgb: 34, 34, 34; + --bs-btn-active-color: var(--color); + --bs-btn-active-bg: var(--color); + --bs-btn-active-border-color: var(--color); + --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + --bs-btn-disabled-color: var(--color); + --bs-btn-disabled-bg: transparent; + --bs-btn-disabled-border-color: var(--color); + } + +} + + +.form-range::-moz-range-track { + background: var(--bs-secondary-bg-subtle); +} + +.form-range::-moz-range-thumb { + background: var(--bs-secondary-color); +} diff --git a/ux.symfony.com/assets/styles/_highlight.scss b/ux.symfony.com/assets/styles/vendor/_highlight.scss similarity index 99% rename from ux.symfony.com/assets/styles/_highlight.scss rename to ux.symfony.com/assets/styles/vendor/_highlight.scss index 8196be3e4f4..ef4a8847af8 100644 --- a/ux.symfony.com/assets/styles/_highlight.scss +++ b/ux.symfony.com/assets/styles/vendor/_highlight.scss @@ -55,4 +55,3 @@ background: rgba(218, 54, 51, .3); outline: 3px solid rgba(218, 54, 51, .3) } - diff --git a/ux.symfony.com/assets/styles/vendor/_tom-select.scss b/ux.symfony.com/assets/styles/vendor/_tom-select.scss new file mode 100644 index 00000000000..2d6d59bce97 --- /dev/null +++ b/ux.symfony.com/assets/styles/vendor/_tom-select.scss @@ -0,0 +1,22 @@ +.ts-dropdown, .ts-control, .ts-control input { + color: var(--bs-body-color); +} + +.ts-dropdown, .ts-dropdown.form-control, .ts-dropdown.form-select { + background: var(--bs-body-bg); + border: 1px solid var(--bs-border-color-translucent); +} + +.disabled .ts-control { + opacity: 0.5; + background: var(--bs-body-bg); +} + +.ts-control, .ts-wrapper.single.input-active .ts-control { + background: var(--bs-body-bg); +} + +.ts-dropdown .active { + background-color: var(--bs-body-bg); + color: var(--bs-body-color); +} diff --git a/ux.symfony.com/public/site.webmanifest b/ux.symfony.com/public/site.webmanifest index bbf841daf7a..d48f4691b5c 100755 --- a/ux.symfony.com/public/site.webmanifest +++ b/ux.symfony.com/public/site.webmanifest @@ -1,2 +1 @@ - {"name":"Symfony UX","short_name":"Symfony UX","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} diff --git a/ux.symfony.com/src/Model/Package.php b/ux.symfony.com/src/Model/Package.php index 79e36d05019..d04afe1ae6c 100644 --- a/ux.symfony.com/src/Model/Package.php +++ b/ux.symfony.com/src/Model/Package.php @@ -13,6 +13,7 @@ public function __construct( private string $name, private string $humanName, private string $route, + private string $color, private string $gradient, private string $description, private string $createString, @@ -35,6 +36,11 @@ public function getRoute(): string return $this->route; } + public function getColor(): string + { + return $this->color; + } + public function getGradient(): string { return $this->gradient; diff --git a/ux.symfony.com/src/Service/PackageRepository.php b/ux.symfony.com/src/Service/PackageRepository.php index 9ee86ba910c..5fedbceeb44 100644 --- a/ux.symfony.com/src/Service/PackageRepository.php +++ b/ux.symfony.com/src/Service/PackageRepository.php @@ -16,7 +16,8 @@ public function findAll(string $query = null): array 'turbo', 'Turbo', 'app_turbo', - 'linear-gradient(95.22deg, #5920A0 -4.7%, #844EC9 105.43%), #5920A0', + '#5920A0', + 'linear-gradient(95.22deg, #5920A0 -4.7%, #844EC9 105.43%)', 'Integration with Turbo for single-page-app and real-time experience', 'I need to transform my app into an SPA!' )) @@ -27,6 +28,7 @@ public function findAll(string $query = null): array 'live-component', 'Live Components', 'app_live_component', + '#AC5727', 'linear-gradient(94.81deg, #AC5727 -1.76%, #CB804A 104.47%)', 'Build dynamic interfaces with zero JavaScript', 'I need Twig templates that update in real-time!' @@ -36,7 +38,8 @@ public function findAll(string $query = null): array 'autocomplete', 'Autocomplete', 'app_autocomplete', - 'linear-gradient(95.22deg, #DF275E -4.7%, #E85995 105.43%), #5920A0', + '#DF275E', + 'linear-gradient(95.22deg, #DF275E -4.7%, #E85995 105.43%)', 'Ajax-powered, auto-completable `select` elements', 'I need an Ajax-autocomplete select field' ), @@ -44,6 +47,7 @@ public function findAll(string $query = null): array 'chartjs', 'Chart.js', 'app_chartjs', + '#21A81E', 'linear-gradient(95.26deg, #21A81E 0.06%, #45DD42 108.28%)', 'Easy charts with Chart.js', 'I need to build a chart' @@ -54,7 +58,8 @@ public function findAll(string $query = null): array 'react', 'React', 'app_react', - 'linear-gradient(95.22deg, #10a2cb -4.7%, #42caf0 105.43%), #5920A0', + '#10A2CB', + 'linear-gradient(95.22deg, #10a2cb -4.7%, #42caf0 105.43%)', 'Quickly render `` components & pass them props.', 'I need to render React components from Twig' )) @@ -64,7 +69,8 @@ public function findAll(string $query = null): array 'vue', 'Vue.js', 'app_vue', - 'linear-gradient(95.22deg, #35b67c -4.7%, #8ce3bc 105.43%)', + '#35b67c', + 'linear-gradient(95.22deg, #35B67C -4.7%, #8CE3BC 105.43%)', 'Quickly render `` components & pass them props.', 'I need to render Vue.js components from Twig' )) @@ -74,6 +80,7 @@ public function findAll(string $query = null): array 'svelte', 'Svelte', 'app_svelte', + '#FF3E00', 'linear-gradient(137.59deg, #FF3E00 -7.89%, #FF8A00 110.57%)', 'Quickly render `` components & pass them props.', 'I need to render Svelte components from Twig', @@ -85,6 +92,7 @@ public function findAll(string $query = null): array 'cropperjs', 'Image Cropper', 'app_cropper', + '#1E8FA8', 'linear-gradient(135.73deg, #1E8FA8 -7.05%, #3FC0DC 105.11%)', 'Form Type and tools for cropping images', 'I need to add a JavaScript image cropper' @@ -95,6 +103,7 @@ public function findAll(string $query = null): array 'lazy-image', 'Lazy Image', 'app_lazy_image', + '#AC2777', 'linear-gradient(133.55deg, #AC2777 -8.06%, #F246AD 104.87%)', 'Optimize Image Loading with BlurHash', 'I need to delay large image loading' @@ -104,7 +113,8 @@ public function findAll(string $query = null): array 'twig-component', 'Twig Components', 'app_twig_component', - 'linear-gradient(95.22deg, #7FA020 -4.7%, #A1C94E 105.43%), #5920A0', + '#7FA020', + 'linear-gradient(95.22deg, #7FA020 -4.7%, #A1C94E 105.43%)', 'Create PHP classes that can render themselves', 'I need to create PHP classes that render' ), @@ -113,6 +123,7 @@ public function findAll(string $query = null): array 'dropzone', 'Stylized Dropzone', 'app_dropzone', + '#AC9F27', 'linear-gradient(135.69deg, #AC9F27 -8.56%, #E8D210 106.51%)', 'Form type for stylized "drop zone" for file uploads', 'I need an upload field that looks great' @@ -121,7 +132,8 @@ public function findAll(string $query = null): array 'swup', 'Swup Integration', 'app_swup', - 'linear-gradient(95.22deg, #D87036 -4.7%, #EA9633 105.43%), #5920A0', + '#D87036', + 'linear-gradient(95.22deg, #D87036 -4.7%, #EA9633 105.43%)', 'Integration with the page transition library Swup', 'I need stylized page transitions' )) @@ -130,6 +142,7 @@ public function findAll(string $query = null): array new Package('notify', 'Notify', 'app_notify', + '#204CA0', 'linear-gradient(94.17deg, #204CA0 -6.1%, #3D82EA 105.25%)', 'Trigger native browser notifications from inside PHP', 'I need to send browser notifications', @@ -138,6 +151,7 @@ public function findAll(string $query = null): array 'toggle-password', 'Toggle Password', 'app_toggle_password', + '#BE0404', 'linear-gradient(142.8deg, #FD963C -14.8%, #BE0404 95.43%)', 'Switch the visibility of a password field', 'I need to toggle the visibility of a password field', @@ -146,7 +160,8 @@ public function findAll(string $query = null): array 'typed', 'Typed', 'app_typed', - 'linear-gradient(95.22deg, #20A091 -4.7%, #4EC9B3 105.43%), #5920A0', + '#20A091', + 'linear-gradient(95.22deg, #20A091 -4.7%, #4EC9B3 105.43%)', 'Animated typing with Typed.js', 'I need to type onto the screen... like this' )) @@ -156,6 +171,7 @@ public function findAll(string $query = null): array 'translator', 'Translator', 'app_translator', + '#2248D0', 'linear-gradient(139.1deg, #2248D0 -20.18%, #00FFB2 113.25%)', "Use Symfony's translations in JavaScript", 'I need to translate strings in JavaScript', diff --git a/ux.symfony.com/templates/_footer.html.twig b/ux.symfony.com/templates/_footer.html.twig new file mode 100644 index 00000000000..4c22d0a7327 --- /dev/null +++ b/ux.symfony.com/templates/_footer.html.twig @@ -0,0 +1,50 @@ + diff --git a/ux.symfony.com/templates/_header.html.twig b/ux.symfony.com/templates/_header.html.twig new file mode 100644 index 00000000000..c2d97f9ea3a --- /dev/null +++ b/ux.symfony.com/templates/_header.html.twig @@ -0,0 +1,20 @@ +
+ +
diff --git a/ux.symfony.com/templates/_main_nav.html.twig b/ux.symfony.com/templates/_main_nav.html.twig deleted file mode 100644 index 6538cda5ed2..00000000000 --- a/ux.symfony.com/templates/_main_nav.html.twig +++ /dev/null @@ -1,55 +0,0 @@ - - diff --git a/ux.symfony.com/templates/_nav.html.twig b/ux.symfony.com/templates/_nav.html.twig new file mode 100644 index 00000000000..149f038ab78 --- /dev/null +++ b/ux.symfony.com/templates/_nav.html.twig @@ -0,0 +1,46 @@ +{% block menu_items %} + Turbo + + + + + + + +{% endblock %} diff --git a/ux.symfony.com/templates/base.html.twig b/ux.symfony.com/templates/base.html.twig index 6a3e2afd218..0f36d3b9561 100644 --- a/ux.symfony.com/templates/base.html.twig +++ b/ux.symfony.com/templates/base.html.twig @@ -9,66 +9,45 @@ + + {% block stylesheets %} {{ ux_controller_link_tags() }} {% endblock %} - {% block javascripts %} + {{ importmap('app') }} {% endblock %} - {% block body %}{% endblock %} + {% block body %} +
+ {% block header %} + {{ include('_header.html.twig') }} + {% endblock %} + + {% block main %} +
+ {% block content %} + {% endblock %} +
+ {% endblock %} -
-
-
- -
-

- - crafted by - SymfonyCasts - & - Locastic, - - - hosted with - - Platform.sh - - -

-
-
-

- © - Symfony - All rights reserved. -

-
-
+ {% block aside %}{% endblock %} + + {% block footer %} + {{ include('_footer.html.twig') }} + {% endblock %}
-
+ {% endblock %} diff --git a/ux.symfony.com/templates/bundles/TwigBundle/Exception/error.html.twig b/ux.symfony.com/templates/bundles/TwigBundle/Exception/error.html.twig new file mode 100644 index 00000000000..80877f31e61 --- /dev/null +++ b/ux.symfony.com/templates/bundles/TwigBundle/Exception/error.html.twig @@ -0,0 +1,29 @@ +{% extends 'base.html.twig' %} + +{% block title %}Error {{ status_code }} - Symfony UX{% endblock %} + +{% block header %} +
+ +
+{% endblock %} + +{% block main %} +
+
+ Error +

{{ status_code }}

+

{{ status_text }}

+ Back to the homepage +
+
+{% endblock %} + +{% block footer %}{% endblock %} diff --git a/ux.symfony.com/templates/components/CodeBlock.html.twig b/ux.symfony.com/templates/components/CodeBlock.html.twig index 481297f8478..82b8c06ee36 100644 --- a/ux.symfony.com/templates/components/CodeBlock.html.twig +++ b/ux.symfony.com/templates/components/CodeBlock.html.twig @@ -1,10 +1,10 @@
{% if showFilename %} -
- {{ filename }} -
+
+ {{ filename }} +
{{ include('partials/code-block-buttons.html.twig', { source: this.rawSource, link: this.githubLink, @@ -12,20 +12,18 @@
{% endif %} -
+
{% if not showFilename %} - {{ include('partials/code-block-buttons.html.twig', { - source: this.rawSource, - link: this.githubLink, - }) }} +
+ {{ include('partials/code-block-buttons.html.twig', { + source: this.rawSource, + link: this.githubLink, + }) }} +
{% endif %} -
+        

             {{- this.highlightSource()|raw -}}
-        
+
{% block code_content_bottom %}
+ +
+
+
diff --git a/ux.symfony.com/templates/components/TabbedCodeBlocks.html.twig b/ux.symfony.com/templates/components/TabbedCodeBlocks.html.twig index 31c26adbc0a..caca8ff9fb6 100644 --- a/ux.symfony.com/templates/components/TabbedCodeBlocks.html.twig +++ b/ux.symfony.com/templates/components/TabbedCodeBlocks.html.twig @@ -1,26 +1,28 @@
-
- -
+
+
+ +
+
{% for filename in files %} -
- +
+
{% endfor %}
diff --git a/ux.symfony.com/templates/components/Terminal.html.twig b/ux.symfony.com/templates/components/Terminal.html.twig index e64d2d78b7d..08ac55afcb5 100644 --- a/ux.symfony.com/templates/components/Terminal.html.twig +++ b/ux.symfony.com/templates/components/Terminal.html.twig @@ -1,12 +1,16 @@
-
- - - +
+
+ + + +
+
+
+
+            {{- this.process(block('content'))|raw -}}
+        
-
-        {{- this.process(block('content'))|raw -}}
-    
diff --git a/ux.symfony.com/templates/components/TerminalCommand.html.twig b/ux.symfony.com/templates/components/TerminalCommand.html.twig new file mode 100644 index 00000000000..adccd69260a --- /dev/null +++ b/ux.symfony.com/templates/components/TerminalCommand.html.twig @@ -0,0 +1,13 @@ +
+ + +
diff --git a/ux.symfony.com/templates/components/ThemeSwitcher.html.twig b/ux.symfony.com/templates/components/ThemeSwitcher.html.twig new file mode 100644 index 00000000000..6b9a4c7f190 --- /dev/null +++ b/ux.symfony.com/templates/components/ThemeSwitcher.html.twig @@ -0,0 +1,10 @@ + diff --git a/ux.symfony.com/templates/components/TodoListForm.html.twig b/ux.symfony.com/templates/components/TodoListForm.html.twig index 885861ac41f..0d31d7c671f 100644 --- a/ux.symfony.com/templates/components/TodoListForm.html.twig +++ b/ux.symfony.com/templates/components/TodoListForm.html.twig @@ -26,12 +26,12 @@ {{ form_row(itemForm.description, { label: false, + row_attr: {class: 'mb-1'}, attr: { placeholder: 'Walk the pygmy hippo' } }) }} - {{ form_row(itemForm.priority, { row_attr: {class: ''}, diff --git a/ux.symfony.com/templates/cropper/cropper.html.twig b/ux.symfony.com/templates/cropper/cropper.html.twig index b3cd35bff94..cddb4bd837a 100644 --- a/ux.symfony.com/templates/cropper/cropper.html.twig +++ b/ux.symfony.com/templates/cropper/cropper.html.twig @@ -37,7 +37,7 @@
{{ form_widget(form) }}
-
+
diff --git a/ux.symfony.com/templates/liveDemoBase.html.twig b/ux.symfony.com/templates/liveDemoBase.html.twig index 56199e33457..991772d3a19 100644 --- a/ux.symfony.com/templates/liveDemoBase.html.twig +++ b/ux.symfony.com/templates/liveDemoBase.html.twig @@ -2,49 +2,57 @@ {% block title %}{{ demo.name }} Demo | Live Components{% endblock %} -{% block body %} -
-
-
- - - Back to all demos - -
DEMO

{{ demo.name }}

- +{% block header %} +
+ -
-
+ +{% endblock %} - {% for message in app.flashes('live_demo_success') %} -
{{ message }}
- {% endfor %} +{% block content %} -
+
+
+ DEMO +

{{ demo.name }}

+
+ {{ demo.longDescription|markdown_to_html }} +
+
+
-
- {{ demo.longDescription|markdown_to_html }} -
+
+ {% for message in app.flashes('live_demo_success') %} +
{{ message }}
+ {% endfor %} +
+
-
+
{% block demo_content %}{% endblock %}
-
{% block code_block_full %} -
- -
-
- {% block code_block_left %}{% endblock %} +
+
+
+ {% block code_block_left %}{% endblock %} +
+
+ {% block code_block_right %}{% endblock %} +
-
- {% block code_block_right %}{% endblock %} -
-
{% endblock %}
+ {% endblock %} diff --git a/ux.symfony.com/templates/live_component/live_component.html.twig b/ux.symfony.com/templates/live_component/live_component.html.twig index 3186b119943..2837b964327 100644 --- a/ux.symfony.com/templates/live_component/live_component.html.twig +++ b/ux.symfony.com/templates/live_component/live_component.html.twig @@ -43,10 +43,11 @@ {% block documentation_links %}{% endblock %} {% block package_bottom %} +

Live Component Demos

-
+

Find out what else you can build

- Read full Documentation @@ -54,20 +55,25 @@
- {% for demo in demos %} -
- +
+ {% for demo in demos %} +
- Screenshot of the {{ demo.name }} demo + Screenshot of the {{ demo.name }} demo
-
-

{{ demo.name }}

+
+

+ {{ demo.name }} +

{{ demo.description }}
- -
- {% endfor %} +
+ {% endfor %} +
{% endblock %} diff --git a/ux.symfony.com/templates/main/_documentationLinks.html.twig b/ux.symfony.com/templates/main/_documentationLinks.html.twig index bf74336fc66..ffdeb4f8112 100644 --- a/ux.symfony.com/templates/main/_documentationLinks.html.twig +++ b/ux.symfony.com/templates/main/_documentationLinks.html.twig @@ -1,33 +1,25 @@ -
-
-
-
- {{ component('DocsLink', { - url: package.officialDocsUrl, - title: 'Symfony UX '~package.humanName~' Docs', - text: 'Get going with the official documentation.' - }) }} -
- +
+ diff --git a/ux.symfony.com/templates/main/_fileTreeLevel.html.twig b/ux.symfony.com/templates/main/_fileTreeLevel.html.twig index d1d16ab19c2..13dbfe53337 100644 --- a/ux.symfony.com/templates/main/_fileTreeLevel.html.twig +++ b/ux.symfony.com/templates/main/_fileTreeLevel.html.twig @@ -1,6 +1,6 @@ {% macro summaryAttributes(description) %} {% if description %} - data-bs-toggle="tooltip" data-bs-html="true" data-bs-placement="right" title="{{ description|e('html_attr') }}" + data-bs-toggle="tooltip" data-bs-html="true" data-bs-placement="auto" title="{{ description|e('html_attr') }}" {% endif %} {% endmacro %} diff --git a/ux.symfony.com/templates/main/_installTerminal.html.twig b/ux.symfony.com/templates/main/_installTerminal.html.twig index 077d5076445..b2c19bbe872 100644 --- a/ux.symfony.com/templates/main/_installTerminal.html.twig +++ b/ux.symfony.com/templates/main/_installTerminal.html.twig @@ -1,12 +1,14 @@ -

Install It

-
-
- {% component Terminal with { bottomPadding: 20 } %} - {% block content %} - composer require {{ package.composerName }} - npm install --force - npm run watch - {% endblock %} - {% endcomponent %} +
+

Install It

+
+
+ {% component Terminal with { bottomPadding: 20 } %} + {% block content %} + composer require {{ package.composerName }} + npm install --force + npm run watch + {% endblock %} + {% endcomponent %} +
diff --git a/ux.symfony.com/templates/main/_package_in_list.html.twig b/ux.symfony.com/templates/main/_package_in_list.html.twig index 2553e485b0e..6c5efd381c2 100644 --- a/ux.symfony.com/templates/main/_package_in_list.html.twig +++ b/ux.symfony.com/templates/main/_package_in_list.html.twig @@ -1,7 +1,7 @@
-
+
Image for the {{ package.humanName }} UX package

{{ package.humanName }}

diff --git a/ux.symfony.com/templates/main/_packagesList.html.twig b/ux.symfony.com/templates/main/_packagesList.html.twig index 047ea578a27..e1df6ff1267 100644 --- a/ux.symfony.com/templates/main/_packagesList.html.twig +++ b/ux.symfony.com/templates/main/_packagesList.html.twig @@ -1,4 +1,5 @@ -
+ +
{% for package in packages %} {% endfor %} diff --git a/ux.symfony.com/templates/main/_testimonials.html.twig b/ux.symfony.com/templates/main/_testimonials.html.twig deleted file mode 100644 index fddb0998030..00000000000 --- a/ux.symfony.com/templates/main/_testimonials.html.twig +++ /dev/null @@ -1,64 +0,0 @@ -

Making life easier for
developers worldwide

-
-
-
-
- “Sed nunc, viverra euismod est lacus. Eget amet nun diam nec feugiat Sed nunc imperdiet amet. Sed nunc, viverra euismod est lacus. Sed nunc, viverra euismod est lacus. -
-
-
-
- -
Jamie Gullen
Co-founder at Acme
-
-
-
- {# #} - - -
- -
-
-
-
- “Sed nunc, viverra euismod est lacus. Eget amet nun diam nec feugiat Sed nunc imperdiet amet. Sed nunc, viverra euismod est lacus. Sed nunc, viverra euismod est lacus. -
-
-
-
- -
Jamie Gullen
Co-founder at Acme
-
-
-
- {# #} - - -
- -
-
-
-
-
-
- “Sed nunc, viverra euismod est lacus. Eget amet nun diam nec feugiat Sed nunc imperdiet amet. Sed nunc, viverra euismod est lacus. Sed nunc, viverra euismod est lacus. -
-
-
-
- -
Jamie Gullen
Co-founder at Acme
-
-
-
- {# #} - - -
- -
-
-
-
diff --git a/ux.symfony.com/templates/main/homepage.html.twig b/ux.symfony.com/templates/main/homepage.html.twig index 66e88944ca4..7441797bd46 100644 --- a/ux.symfony.com/templates/main/homepage.html.twig +++ b/ux.symfony.com/templates/main/homepage.html.twig @@ -1,21 +1,23 @@ {% extends 'base.html.twig' %} -{% block body %} -
- {{ include('_main_nav.html.twig') }} -
-
- curated by symfony -

JavaScript tools you can't live without.

-

A set of PHP & JavaScript packages to solve every day frontend problems featuring Stimulus and Turbo.

-
-
- {{ component('HomepageTerminalSwapper') }} -
+{% block content %} +
+
+ +
+
+ curated by symfony +

JavaScript tools you can't live without.

+

A set of PHP & JavaScript packages to solve every day frontend problems featuring Stimulus and Turbo.

+
+
+ {{ component('HomepageTerminalSwapper', {class: 'shadow-blur shadow-blur--rainbow', style: '--shadow-bottom: 2rem;'}) }} +
+
-
+

Install it

@@ -32,7 +34,7 @@
-
+
    {{ include('main/_fileTreeLevel.html.twig', { @@ -45,9 +47,9 @@

Stimulus Controllers

-
-

Write custom JavaScript inside Stimulus Controllers

- + {% block markdown_example %} -
-
- -
-
- -
-
-
- (click "Convert") +
+
+ +
+
+ +
+
+
+ (click "Convert") +
-
{% endblock %}

Packages

-
-

Install extra Packages

-
+
+

Install extra Packages

+
Browse all Packages @@ -102,9 +104,5 @@
{{ include('main/_packagesList.html.twig') }}
- - {# - {{ include('main/_testimonials.html.twig') }} - #}
{% endblock %} diff --git a/ux.symfony.com/templates/main/packages.html.twig b/ux.symfony.com/templates/main/packages.html.twig index 14a8ef42329..7d24254c5ef 100644 --- a/ux.symfony.com/templates/main/packages.html.twig +++ b/ux.symfony.com/templates/main/packages.html.twig @@ -2,27 +2,29 @@ {% block title %}All Symfony UX Packages{% endblock %} -{% block body %} -
- {{ include('_main_nav.html.twig') }} - -

All Packages

+{% block content %} +
+
+

All Packages

A treasure chest of packages to solve your
frontend problems.

+
+
+ +
{{ include('main/_packagesList.html.twig') }}
+{% endblock %} -
-
-
-
+{% block aside %} +
+
+
{{ component('DocsLink', { url: 'https://symfonycasts.com/screencast/stimulus', title: 'Screencasts', text: 'Jump right into with the Symfony UX & Stimulus screencast.' }) }} -
-
{{ component('DocsLink', { url: 'https://symfony.com/doc/current/frontend/ux.html', title: 'Documentation', @@ -31,6 +33,4 @@
-
- {% endblock %} diff --git a/ux.symfony.com/templates/packageBase.html.twig b/ux.symfony.com/templates/packageBase.html.twig index 0d4b39cf559..23bd54364d0 100644 --- a/ux.symfony.com/templates/packageBase.html.twig +++ b/ux.symfony.com/templates/packageBase.html.twig @@ -3,10 +3,17 @@ {% set package = twigPackageHelper.currentPackage() %} {% block title %}{{ package.humanName }} | Symfony UX Packages{% endblock %} -{% block body %} +{% block header %} + {{ include('_header.html.twig', { + theme: 'white' + }) }} +{% endblock %} + +{% block content %} + {% block package_header %}{% endblock %} -
+
@@ -42,4 +49,5 @@ package: package }) }} {% endblock %} + {% endblock %} diff --git a/ux.symfony.com/templates/turbo/turbo.html.twig b/ux.symfony.com/templates/turbo/turbo.html.twig index 80ca8760320..08264cb90e1 100644 --- a/ux.symfony.com/templates/turbo/turbo.html.twig +++ b/ux.symfony.com/templates/turbo/turbo.html.twig @@ -1,11 +1,10 @@ {% extends 'packageBase.html.twig' %} -{% block body %} +{% block content %} {% component PackageHeader with { package: 'turbo', - eyebrowText: 'Speed of an SPA', - withChatIcon: true + eyebrowText: 'Speed of an SPA' } %} {% block title_header %} Turbo your @@ -15,22 +14,30 @@ {% block sub_content %} The speed of a single-page web app without writing any JavaScript, courtesy of Turbo + +
+ {{ include('turbo/_chatMessageCount.html.twig', {messageCount: this.messageCount }) }} +
{% endblock %} + {% endcomponent %} -
-
+
+ +
-

Turbo Drive

-

Transform all link clicks and form submits into Ajax - calls to get that single-page-application feel.

- -
- Icon to indication information -

- - Click any links on this site or submit this form. - Zero full page refreshes!

+
+

Turbo Drive

+

Transform all link clicks and form submits into Ajax + calls to get that single-page-application feel.

+ +
+ Icon to indication information +

+ + Click any links on this site or submit this form. + Zero full page refreshes!

+
@@ -66,20 +73,22 @@ {% endblock %} {% endembed %}
-
+ -
+
-

Turbo Frames

-
Decompose complex pages into different parts that load and behave independently. Try it - it's smooth.
- -
- Icon to indication information -

- The frame displays just part of the full page from - {{ url('app_turbo_todo_list') }}. - All link clicks and form submits stay *inside* the frame. -

+
+

Turbo Frames

+
Decompose complex pages into different parts that load and behave independently. Try it - it's smooth.
+ +
+ Icon to indication information +

+ The frame displays just part of the full page from + {{ url('app_turbo_todo_list') }}. + All link clicks and form submits stay *inside* the frame. +

+
@@ -96,24 +105,26 @@ {% endblock %} {% endembed %}
-
+ -
+
-

Turbo Streams

-
- Deliver page updates - to *any* elements on your page - - directly from Symfony. Add Mercure to do this for *any* - users on your site, in real-time. +
+

Turbo Streams

+
+ Deliver page updates - to *any* elements on your page - + directly from Symfony. Add Mercure to do this for *any* + users on your site, in real-time. -
+
-
- Icon to indication information -

- Chat with someone else viewing this page (or open a - 2nd browser tab to talk to yourself)! Submitting also - updates the icon in the header.

+
+ Icon to indication information +

+ Chat with someone else viewing this page (or open a + 2nd browser tab to talk to yourself)! Submitting also + updates the icon in the header.

+
@@ -137,11 +148,14 @@ {% endblock %} {% endembed %}
-
+
- {{ include('main/_installTerminal.html.twig') }} +
+ {{ include('main/_installTerminal.html.twig') }} +
{{ include('main/_documentationLinks.html.twig') }} + {% endblock %} diff --git a/ux.symfony.com/templates/ux_packages/translator.html.twig b/ux.symfony.com/templates/ux_packages/translator.html.twig index 46e85fb3740..a57159f39a3 100644 --- a/ux.symfony.com/templates/ux_packages/translator.html.twig +++ b/ux.symfony.com/templates/ux_packages/translator.html.twig @@ -42,19 +42,21 @@
-
Code
+
Code
-
Result
+
Result
-
Parameters
+
Parameters
-

+                
+

+                
@@ -63,7 +65,9 @@
-

+                
+

+                
@@ -87,7 +91,9 @@
-

+                
+

+                
@@ -128,7 +134,9 @@
-

+                
+

+                
@@ -154,7 +162,9 @@
-

+                
+

+                
@@ -179,7 +189,9 @@
-

+                
+

+                
@@ -203,7 +215,9 @@
-

+                
+

+                
@@ -226,7 +240,9 @@
-

+                
+

+                
@@ -248,4 +264,5 @@
+
{% endblock %} diff --git a/ux.symfony.com/templates/ux_packages/twig-component.html.twig b/ux.symfony.com/templates/ux_packages/twig-component.html.twig index ab69854fb85..638005f8eb1 100644 --- a/ux.symfony.com/templates/ux_packages/twig-component.html.twig +++ b/ux.symfony.com/templates/ux_packages/twig-component.html.twig @@ -28,14 +28,14 @@ {% block demo_content %}
-
+
{% block alert_success_example %} {{ component('Alert', { message: 'I am a success alert!', }) }} {% endblock %}
-
+
-
+
{% block alert_danger_example %} {{ component('Alert', { type: 'danger', @@ -55,7 +55,7 @@ }) }} {% endblock %}
-
+
+