diff --git a/css/app.css b/css/app.css index ffac3dc..40977b1 100644 --- a/css/app.css +++ b/css/app.css @@ -3893,7 +3893,7 @@ article > *:not(.entry-content, .chapter-header-block), } .entry-content > :first-child { - margin-top: 0px; + margin-top: 0px !important; } .entry-content h1 { @@ -4589,6 +4589,77 @@ article > *:not(.entry-content, .chapter-header-block), z-index: 9999; } +.homegrade-blocks-plus-loin { + margin-top: 2rem; + margin-bottom: 2rem; + --tw-bg-opacity: 1; + background-color: rgb(47 1 84 / var(--tw-bg-opacity)); + padding: 3rem; + border-radius: 22px; +} + +.homegrade-blocks-plus-loin__block-title { + margin-top: 0px !important; + font-size: 2.25rem !important; + line-height: 2.5rem !important; +} + +.homegrade-blocks-plus-loin p, + .homegrade-blocks-plus-loin h3, + .homegrade-blocks-plus-loin h4, + .homegrade-blocks-plus-loin h5, + .homegrade-blocks-plus-loin h6, + .homegrade-blocks-plus-loin li, + .homegrade-blocks-plus-loin a { + --tw-text-opacity: 1 !important; + color: rgb(255 255 255 / var(--tw-text-opacity)) !important; +} + +.homegrade-blocks-plus-loin a { + font-weight: 500 !important; + text-decoration-thickness: 1px !important; +} + +.homegrade-blocks-plus-loin ul li:before { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.homegrade-blocks-plus-loin ul li::marker { + --tw-text-opacity: 1 !important; + color: rgb(255 255 255 / var(--tw-text-opacity)) !important; +} + +.homegrade-blocks-plus-loin .homegrade-blocks-custom-heading + ul { + padding-left: 3rem; +} + +.homegrade-blocks-custom-heading.has-icon:before { + --tw-bg-opacity: 1; + background-color: rgb(47 1 84 / var(--tw-bg-opacity)); +} + +.homegrade-blocks-plus-loin .homegrade-blocks-custom-heading.has-icon.has-icon:before { + --tw-bg-opacity: 1; + background-color: rgb(255 233 163 / var(--tw-bg-opacity)); +} + +.homegrade-blocks-plus-loin .homegrade-blocks-custom-heading.has-icon.has-icon--key::before { + background-image: url('../resources/img/pictogrammes/icon_key_dark.svg'); +} + +.homegrade-blocks-plus-loin .homegrade-blocks-custom-heading.has-icon.has-icon--house::before { + background-image: url('../resources/img/pictogrammes/icon_house_dark.svg'); +} + +.homegrade-blocks-plus-loin .homegrade-blocks-custom-heading.has-icon.has-icon--bulb::before { + background-image: url('../resources/img/pictogrammes/icon_bulb_dark.svg'); +} + +.homegrade-blocks-plus-loin .homegrade-blocks-custom-heading.has-icon.has-icon--chain::before { + background-image: url('../resources/img/pictogrammes/icon_chain_dark.svg'); +} + /* ########### PAGE ############ */ .demo-components .title { diff --git a/includes/admin.php b/includes/admin.php index 1867ad1..100605d 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -258,16 +258,14 @@ function wpdocs_admin_classes($classes) // } global $pagenow; global $post; - // echo '
'; - // write_log($post); - // echo ''; + $thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null; $thematiqueParent = getParentThematique($thematique); $thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug) ?? null; if (in_array($pagenow, array('post.php', 'post-new.php'), true) && $thematiqueColorSlug) { - $classes .= ' salut ' . $thematiqueColorSlug; + $classes .= ' ' . $thematiqueParent->slug; } return $classes; diff --git a/js/app.js b/js/app.js index c9c55c0..7ed53e0 100644 --- a/js/app.js +++ b/js/app.js @@ -224,6 +224,9 @@ // resources/js/single-conseil.js function singleConseil() { + const hasChapterIndex = document.querySelector(".chapter_index__list"); + if (!hasChapterIndex) + return; let chapterIndex = document.querySelector(".chapter_index"); let questionBlocks = document.querySelectorAll(".questions-container-block"); function handleLinksBehavior() { diff --git a/resources/css/app.css b/resources/css/app.css index 7fe4fa7..f11dad0 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -62,6 +62,8 @@ @import './blocks/vocabulaire-summary.css'; @import './blocks/aside.css'; @import './blocks/focused-schema.css'; +@import './blocks/plus-loin.css'; +@import './blocks/content-heading.css'; /* ########### PAGE ############ */ @import './pages/demo-components.css'; diff --git a/resources/css/blocks/content-heading.css b/resources/css/blocks/content-heading.css new file mode 100644 index 0000000..a932328 --- /dev/null +++ b/resources/css/blocks/content-heading.css @@ -0,0 +1,25 @@ +.homegrade-blocks-custom-heading.has-icon { + &:before { + @apply bg-primary; + } +} + +.homegrade-blocks-plus-loin { + .homegrade-blocks-custom-heading.has-icon { + &.has-icon:before { + @apply bg-infos; + } + &.has-icon--key::before { + background-image: url('../resources/img/pictogrammes/icon_key_dark.svg'); + } + &.has-icon--house::before { + background-image: url('../resources/img/pictogrammes/icon_house_dark.svg'); + } + &.has-icon--bulb::before { + background-image: url('../resources/img/pictogrammes/icon_bulb_dark.svg'); + } + &.has-icon--chain::before { + background-image: url('../resources/img/pictogrammes/icon_chain_dark.svg'); + } + } +} diff --git a/resources/css/blocks/plus-loin.css b/resources/css/blocks/plus-loin.css new file mode 100644 index 0000000..c8f81e8 --- /dev/null +++ b/resources/css/blocks/plus-loin.css @@ -0,0 +1,27 @@ +.homegrade-blocks-plus-loin { + @apply bg-primary p-12 rounding-radius my-8; + &__block-title { + @apply !mt-0 !text-4xl; + } + p, + h3, + h4, + h5, + h6, + li, + a { + @apply !text-white; + } + a { + @apply !font-medium !decoration-1; + } + ul li:before { + @apply bg-white; + } + ul li::marker { + @apply !text-white; + } + .homegrade-blocks-custom-heading + ul { + @apply pl-12; + } +} diff --git a/resources/css/editor-content/gutenberg.css b/resources/css/editor-content/gutenberg.css index e4f7561..35305f4 100644 --- a/resources/css/editor-content/gutenberg.css +++ b/resources/css/editor-content/gutenberg.css @@ -6,7 +6,7 @@ article > *:not(.entry-content, .chapter-header-block), @apply mt-4 lg:mt-0; max-width: 800px; & > :first-child { - @apply mt-0; + @apply !mt-0; } h1 { @apply text-2xl; diff --git a/resources/img/pictogrammes/icon_bulb_dark.svg b/resources/img/pictogrammes/icon_bulb_dark.svg new file mode 100644 index 0000000..3c5e87b --- /dev/null +++ b/resources/img/pictogrammes/icon_bulb_dark.svg @@ -0,0 +1,9 @@ + diff --git a/resources/img/pictogrammes/icon_bulb_light.svg b/resources/img/pictogrammes/icon_bulb_light.svg new file mode 100644 index 0000000..bd7eb62 --- /dev/null +++ b/resources/img/pictogrammes/icon_bulb_light.svg @@ -0,0 +1,9 @@ + diff --git a/resources/img/pictogrammes/icon_chain_dark.svg b/resources/img/pictogrammes/icon_chain_dark.svg new file mode 100644 index 0000000..708ae96 --- /dev/null +++ b/resources/img/pictogrammes/icon_chain_dark.svg @@ -0,0 +1,6 @@ + diff --git a/resources/img/pictogrammes/icon_chain_light.svg b/resources/img/pictogrammes/icon_chain_light.svg new file mode 100644 index 0000000..ffd3f80 --- /dev/null +++ b/resources/img/pictogrammes/icon_chain_light.svg @@ -0,0 +1,6 @@ + diff --git a/resources/img/pictogrammes/icon_house_dark.svg b/resources/img/pictogrammes/icon_house_dark.svg new file mode 100644 index 0000000..1fbfb0f --- /dev/null +++ b/resources/img/pictogrammes/icon_house_dark.svg @@ -0,0 +1,3 @@ + diff --git a/resources/img/pictogrammes/icon_house_light.svg b/resources/img/pictogrammes/icon_house_light.svg new file mode 100644 index 0000000..4b1a4c8 --- /dev/null +++ b/resources/img/pictogrammes/icon_house_light.svg @@ -0,0 +1,3 @@ + diff --git a/resources/img/pictogrammes/icon_key_dark.svg b/resources/img/pictogrammes/icon_key_dark.svg new file mode 100644 index 0000000..f4ea84e --- /dev/null +++ b/resources/img/pictogrammes/icon_key_dark.svg @@ -0,0 +1,3 @@ + diff --git a/resources/img/pictogrammes/icon_key_light.svg b/resources/img/pictogrammes/icon_key_light.svg new file mode 100644 index 0000000..c1f711b --- /dev/null +++ b/resources/img/pictogrammes/icon_key_light.svg @@ -0,0 +1,3 @@ + diff --git a/resources/js/single-conseil.js b/resources/js/single-conseil.js index 86628c9..681e23e 100644 --- a/resources/js/single-conseil.js +++ b/resources/js/single-conseil.js @@ -1,4 +1,7 @@ export default function singleConseil() { + const hasChapterIndex = document.querySelector('.chapter_index__list'); + if (!hasChapterIndex) return; + let chapterIndex = document.querySelector('.chapter_index'); let questionBlocks = document.querySelectorAll('.questions-container-block'); diff --git a/theme.json b/theme.json index b308fce..4d569e1 100644 --- a/theme.json +++ b/theme.json @@ -29,6 +29,11 @@ "slug": "secondary-light", "color": "#FFEDEC" }, + { + "name": "Infos", + "slug": "infos", + "color": "#FFE9A3" + }, { "name": "Secondaire Au Survol", "slug": "secondary-hover",