From 32b5cadebb7f0963fa31f5b8f210dcb7b4a5ed29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Mon, 24 Jun 2024 14:14:26 +0000 Subject: [PATCH] Cn compilation fix --- .../themes/ldc/css/cn-inline-buttons.min.css | 1 + content/themes/ldc/functions.php | 2 +- content/themes/ldc/package.json | 2 +- content/themes/ldc/partials/brands-list.php | 58 +++++++++---------- .../_cn-inline-buttons.scss} | 37 ++++++++---- 5 files changed, 58 insertions(+), 42 deletions(-) create mode 100644 content/themes/ldc/css/cn-inline-buttons.min.css rename content/themes/ldc/{css/cn-inline-buttons.css => sass/_cn-inline-buttons.scss} (72%) diff --git a/content/themes/ldc/css/cn-inline-buttons.min.css b/content/themes/ldc/css/cn-inline-buttons.min.css new file mode 100644 index 00000000..2a2c9843 --- /dev/null +++ b/content/themes/ldc/css/cn-inline-buttons.min.css @@ -0,0 +1 @@ +.cn-cookie-activate{display:flex;flex-direction:row;font-size:calc(.9rem + .1vw) !important;background-color:#fff;padding:.6rem 1rem;border-radius:1rem;justify-content:center;align-items:center;border-width:2px;border-style:solid;border-color:#000}.cn-cookie-activate.w-100{max-width:inherit !important}.cn-cookie-activate span{font-size:calc(.9rem + .1vw) !important}@media screen and (min-width: 500px),print and (min-width: 500px){.cn-cookie-activate span{font-size:calc(.9rem + .1vw) !important}}@media screen and (min-width: 500px),print and (min-width: 500px){.cn-cookie-activate{font-size:calc(.9rem + .1vw) !important}}@media screen and (min-width: 768px),print and (min-width: 768px){.cn-cookie-activate{flex-direction:row}}.cn-cookie-activate button{font-size:.9rem !important;height:fit-content;padding:.8rem .6rem;border-width:.1rem;border-radius:1rem}@media screen and (min-width: 500px),print and (min-width: 500px){.cn-cookie-activate button{font-size:calc(.9rem + .1vw) !important}}@media screen and (min-width: 768px),print and (min-width: 768px){.cn-cookie-activate button{font-size:calc(.9rem - .1vw) !important}}@media screen and (min-width: 1024px),print and (min-width: 1024px){.cn-cookie-activate button{font-size:.9rem !important}}.cn-cookie-activate>span{margin-bottom:.9rem;display:flex;flex-direction:column;color:#e11c1b;font-weight:bold}@media screen and (min-width: 500px),print and (min-width: 500px){.cn-cookie-activate>span{margin-bottom:initial}}.cn-cookie-activate>span>small{color:initial;font-weight:initial;opacity:.5}.cn-cookie-activate.d-none{display:none}.justify-content-center{justify-content:center !important} diff --git a/content/themes/ldc/functions.php b/content/themes/ldc/functions.php index 4f462b7b..94b87fdd 100644 --- a/content/themes/ldc/functions.php +++ b/content/themes/ldc/functions.php @@ -106,7 +106,7 @@ function load_js_css() wp_enqueue_style('cookie', get_template_directory_uri() . $_style_cookies, [], filemtime(get_template_directory() . $_style_cookies)); $_js_cookies = '/js/ldcweb-cn.min.js'; wp_enqueue_script('cookie', get_template_directory_uri() . $_js_cookies, [], null, filemtime(get_template_directory() . $_js_cookies)); - $_style_inline_cookies = '/css/cn-inline-buttons.css'; + $_style_inline_cookies = '/css/cn-inline-buttons.min.css'; wp_enqueue_style('inline-cookie', get_template_directory_uri() . $_style_inline_cookies, [], filemtime(get_template_directory() . $_style_inline_cookies)); $_js_inline_cookies = '/js/cn-inline-buttons.js'; wp_enqueue_script('inline-cookie', get_template_directory_uri() . $_js_inline_cookies, ['cookie'], filemtime(get_template_directory() . $_js_inline_cookies), true); diff --git a/content/themes/ldc/package.json b/content/themes/ldc/package.json index e2175396..677a4390 100644 --- a/content/themes/ldc/package.json +++ b/content/themes/ldc/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "prod": "npm run cookieNotice", - "cookieNotice": "npx sass --style=compressed --no-source-map ./sass/_cookies-notice.scss css/cookies-ldc.min.css && cp node_modules/@ldc-web/cookie-notice/dist/browser/cookie-cn.js js/ldcweb-cn.min.js" + "cookieNotice": "npx sass --style=compressed --no-source-map ./sass/_cn-inline-buttons.scss css/cn-inline-buttons.min.css && npx sass --style=compressed --no-source-map ./sass/_cookies-notice.scss css/cookies-ldc.min.css && cp node_modules/@ldc-web/cookie-notice/dist/browser/cookie-cn.js js/ldcweb-cn.min.js" }, "author": "", "license": "MIT", diff --git a/content/themes/ldc/partials/brands-list.php b/content/themes/ldc/partials/brands-list.php index ed5b11ec..e90fed96 100644 --- a/content/themes/ldc/partials/brands-list.php +++ b/content/themes/ldc/partials/brands-list.php @@ -1,65 +1,65 @@ - + - - + + -
+
- - - -
+ + + +
- +
-
+
- + - + - +
@@ -70,8 +70,8 @@ -
- - +
+ + - + \ No newline at end of file diff --git a/content/themes/ldc/css/cn-inline-buttons.css b/content/themes/ldc/sass/_cn-inline-buttons.scss similarity index 72% rename from content/themes/ldc/css/cn-inline-buttons.css rename to content/themes/ldc/sass/_cn-inline-buttons.scss index 12b65f35..34384f33 100644 --- a/content/themes/ldc/css/cn-inline-buttons.css +++ b/content/themes/ldc/sass/_cn-inline-buttons.scss @@ -1,3 +1,21 @@ +$large_screen: 1366px; +$big_screen: 1200px; +$desktop: 1024px; +$tablet: 768px; +$mobile: 500px; +$xmobile: 320px; + +@mixin min-width($width) { + @media screen and (min-width: $width), print and (min-width: $width) { + @content; + } +} +@mixin max-width($width) { + @media screen and (max-width: $width), print and (max-width: $width) { + @content; + } +} + .cn-cookie-activate { display: flex; flex-direction: row; @@ -19,22 +37,19 @@ // * Prevent weird theme override span { font-size: calc(0.9rem + 0.1vw) !important; - @include media(">phone") { + @include min-width($mobile) { font-size: calc(0.9rem + 0.1vw) !important; } } - @include media(">phone") { - max-width: 80%; + @include min-width($mobile) { // * Prevent weird theme override font-size: calc(0.9rem + 0.1vw) !important; } - @include media(">tablet") { + @include min-width($tablet) { flex-direction: row; - max-width: 70%; } - @include media(">desktop") { - max-width: 50%; + @include min-width($desktop) { } button { @@ -44,15 +59,15 @@ padding: 0.8rem 0.6rem; border-width: 0.1rem; border-radius: 1rem; - @include media(">phone") { + @include min-width($mobile) { // * Prevent weird theme override font-size: calc(0.9rem + 0.1vw) !important; } - @include media(">tablet") { + @include min-width($tablet) { // * Prevent weird theme override font-size: calc(0.9rem - 0.1vw) !important; } - @include media(">desktop") { + @include min-width($desktop) { // * Prevent weird theme override font-size: 0.9rem !important; } @@ -65,7 +80,7 @@ color: #e11c1b; font-weight: bold; - @include media(">phone") { + @include min-width($mobile) { margin-bottom: initial; }