From c85f33675e3679c157667ac65edeb665417cf960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sat, 2 Nov 2024 03:52:19 +0100 Subject: [PATCH] colors --- ux.symfony.com/assets/styles/app.scss | 6 + ux.symfony.com/assets/styles/app/_border.scss | 18 ++ ux.symfony.com/assets/styles/app/_color.scss | 58 ++++ ux.symfony.com/assets/styles/ux/_code.scss | 10 + .../assets/styles/ux/_packages.scss | 10 + .../src/Controller/StyleController.php | 25 ++ .../templates/components/Hero.html.twig | 2 +- .../templates/style/index.html.twig | 263 ++++++++++++++++++ 8 files changed, 391 insertions(+), 1 deletion(-) create mode 100644 ux.symfony.com/assets/styles/app/_border.scss create mode 100644 ux.symfony.com/assets/styles/app/_color.scss create mode 100644 ux.symfony.com/assets/styles/ux/_code.scss create mode 100644 ux.symfony.com/assets/styles/ux/_packages.scss create mode 100644 ux.symfony.com/src/Controller/StyleController.php create mode 100644 ux.symfony.com/templates/style/index.html.twig diff --git a/ux.symfony.com/assets/styles/app.scss b/ux.symfony.com/assets/styles/app.scss index b5da5a7be79..11dfa1b4b05 100644 --- a/ux.symfony.com/assets/styles/app.scss +++ b/ux.symfony.com/assets/styles/app.scss @@ -76,4 +76,10 @@ @import "./images"; +// Symfony UX +@import "app/color"; + + +@import "ux/packages"; + diff --git a/ux.symfony.com/assets/styles/app/_border.scss b/ux.symfony.com/assets/styles/app/_border.scss new file mode 100644 index 00000000000..16b7a5e6676 --- /dev/null +++ b/ux.symfony.com/assets/styles/app/_border.scss @@ -0,0 +1,18 @@ + +:root { + + --border-radius-thinnest: .5rem; + --border-radius-thinner: 1rem; + --border-radius: 1.5rem; + --border-radius-thicker: 2rem; + --border-radius-thickest: 3rem; + + --border-radius-percent-light: 6.25%; + --border-radius-percent: 12.5%; + --border-radius-percent-bold: 18.75%; + + + + + +} diff --git a/ux.symfony.com/assets/styles/app/_color.scss b/ux.symfony.com/assets/styles/app/_color.scss new file mode 100644 index 00000000000..13879ef89f9 --- /dev/null +++ b/ux.symfony.com/assets/styles/app/_color.scss @@ -0,0 +1,58 @@ +:root { + + --color-base: #ffffff; + --color-base-contrast: #000000; + + @media (prefers-color-scheme: dark) { + --color-base: #000000; + --color-base-contrast: #ffffff; + } +} + +:root { + + --color-main: #ffffff; + --color-accent: #1a73e8; + + --color-success: #84DE2C; + --color-info: #007bff; + --color-warning: #FBC640; + --color-danger: #FB4040; + + --bg-base: #121212; + --bg-main: color-mix(in lch, var(--bg-base), #ffffff 10%); + --bg-muted: color-mix(in lch, var(--bg-base), #ffffff 20%); + + --fg-base: #ffffff; + --fg-main: color-mix(in lch, var(--fg-base), #000000 90%); + --fg-muted: color-mix(in lch, var(--fg-base), #000000 50%); + + --bg-accent: var(--color-accent); + --bg-accent-muted: color-mix(in lch, var(--bg-accent), #000000 20%); + + --fg-accent: var(--bg-accent); + --fg-accent-muted: color-mix(in lch, var(--bg-accent), #000000 50%); + + --bg-code: color-mix(in lch, var(--bg-main), #000000 10%); + --bg-quote: color-mix(in lch, var(--bg-main), #ffffff 5%); + --bg-highlight: color-mix(in lch, var(--bg-accent), #ffffff 30%); + + --fg-code: color-mix(in lch, var(--fg-base), #1a73e8 10%); + --fg-quote: var(--fg-muted); + --fg-highlight: color-mix(in lch, var(--fg-base), #1a73e8 15%); + + --bg-interactive: var(--bg-accent); + --bg-interactive-muted: color-mix(in lch, var(--bg-interactive), #000000 20%); + + --bg-info: color-mix(in lch, var(--color-info), var(--bg-main) 15%); + --bg-success: color-mix(in lch, var(--color-success), var(--bg-main) 15%); + --bg-error: color-mix(in lch, var(--color-danger), var(--bg-main) 15%); + --bg-warning: color-mix(in lch, var(--color-warning), var(--bg-main) 15%); + + --fg-interactive: var(--fg-accent); + + --fg-info: var(--fg-base); + --fg-success: var(--fg-base); + --fg-error: var(--fg-base); + --fg-warning: var(--fg-base); +} diff --git a/ux.symfony.com/assets/styles/ux/_code.scss b/ux.symfony.com/assets/styles/ux/_code.scss new file mode 100644 index 00000000000..c0d0194bdf4 --- /dev/null +++ b/ux.symfony.com/assets/styles/ux/_code.scss @@ -0,0 +1,10 @@ +:root { + + + + + + + + +} diff --git a/ux.symfony.com/assets/styles/ux/_packages.scss b/ux.symfony.com/assets/styles/ux/_packages.scss new file mode 100644 index 00000000000..c0d0194bdf4 --- /dev/null +++ b/ux.symfony.com/assets/styles/ux/_packages.scss @@ -0,0 +1,10 @@ +:root { + + + + + + + + +} diff --git a/ux.symfony.com/src/Controller/StyleController.php b/ux.symfony.com/src/Controller/StyleController.php new file mode 100644 index 00000000000..98b3972dfb8 --- /dev/null +++ b/ux.symfony.com/src/Controller/StyleController.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace App\Controller; + +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Attribute\Route; + +class StyleController extends AbstractController +{ + #[Route('/style/', name: 'app_style')] + public function index(): Response + { + return $this->render('style/index.html.twig'); + } +} diff --git a/ux.symfony.com/templates/components/Hero.html.twig b/ux.symfony.com/templates/components/Hero.html.twig index 8a2e5cc5a41..598fc814267 100644 --- a/ux.symfony.com/templates/components/Hero.html.twig +++ b/ux.symfony.com/templates/components/Hero.html.twig @@ -30,7 +30,7 @@ {%- if subtitle -%}

{{- subtitle -}}

{%- endif -%} - {%- if (block('content') is defined) or (description is defined) -%} + {%- if (block('content') is defined) or description is not null -%}
{{- description ?? block('content') -}}
diff --git a/ux.symfony.com/templates/style/index.html.twig b/ux.symfony.com/templates/style/index.html.twig new file mode 100644 index 00000000000..e19ba5b1610 --- /dev/null +++ b/ux.symfony.com/templates/style/index.html.twig @@ -0,0 +1,263 @@ +{% extends 'base.html.twig' %} + +{% block title 'Twig - The flexible, fast, and secure PHP template engine' %} + +{% block meta '' %} + +{% block content %} + +
+
+

Color Palette

+

These are the colors used in the design system.

+ + {{ block('colorboxes') }} + +
+
+ +{% endblock %} + + +{% block colorboxes %} + + +
+ +
Main
+ + +
Dark XXX
+
Dark YYY
+
Dark ZZZ
+ + +
Code
+ + +
Info
+
Success
+
Error
+
Warning
+ + +
Browser Background
+
Browser Bar
+ + +
Card Background
+
+{% endblock %} + +{% block colorboxes2 %} + + +
+ +
Main
+ + +
Dark XXX
+
Dark YYY
+
Dark ZZZ
+ + +
Code
+ + +
Info
+
Success
+
Error
+
Warning
+
+{% endblock %}