From fd3aa184690b837cca2ce7f11248a761f0036bf8 Mon Sep 17 00:00:00 2001 From: Ans Date: Thu, 9 May 2024 12:08:21 -0400 Subject: [PATCH] Move partially-styled-link CSS to Wagtail block --- .../jinja2/ask-cfpb/landing-page.html | 1 - cfgov/unprocessed/css/on-demand/ask.less | 1 - .../partially-styled-link.less | 2 ++ cfgov/v1/atomic_elements/molecules.py | 3 ++ .../includes/atoms/partially-styled-link.html | 29 ------------------- 5 files changed, 5 insertions(+), 31 deletions(-) rename cfgov/unprocessed/css/{atoms => on-demand}/partially-styled-link.less (92%) delete mode 100644 cfgov/v1/jinja2/v1/includes/atoms/partially-styled-link.html diff --git a/cfgov/ask_cfpb/jinja2/ask-cfpb/landing-page.html b/cfgov/ask_cfpb/jinja2/ask-cfpb/landing-page.html index 3672617fc77..d7c25838f1c 100644 --- a/cfgov/ask_cfpb/jinja2/ask-cfpb/landing-page.html +++ b/cfgov/ask_cfpb/jinja2/ask-cfpb/landing-page.html @@ -1,5 +1,4 @@ {% extends 'v1/layouts/layout-2-1.html' %} -{% import 'v1/includes/atoms/partially-styled-link.html' as partially_styled_link with context %} {% import 'v1/includes/templates/render_block.html' as render_block with context %} {% import 'v1/includes/organisms/ask-search.html' as ask_search with context %} diff --git a/cfgov/unprocessed/css/on-demand/ask.less b/cfgov/unprocessed/css/on-demand/ask.less index fb5104cda78..366ff45c1be 100644 --- a/cfgov/unprocessed/css/on-demand/ask.less +++ b/cfgov/unprocessed/css/on-demand/ask.less @@ -1,5 +1,4 @@ @import (reference) '../main.less'; -@import (less) '../atoms/partially-styled-link.less'; /* ========================================================================== consumerfinance.gov diff --git a/cfgov/unprocessed/css/atoms/partially-styled-link.less b/cfgov/unprocessed/css/on-demand/partially-styled-link.less similarity index 92% rename from cfgov/unprocessed/css/atoms/partially-styled-link.less rename to cfgov/unprocessed/css/on-demand/partially-styled-link.less index ac15be09f4d..283ad69074b 100644 --- a/cfgov/unprocessed/css/atoms/partially-styled-link.less +++ b/cfgov/unprocessed/css/on-demand/partially-styled-link.less @@ -1,3 +1,5 @@ +@import (reference) 'cfpb-core.less'; + .a-link--partially-styled { border-bottom-width: 0; diff --git a/cfgov/v1/atomic_elements/molecules.py b/cfgov/v1/atomic_elements/molecules.py index 2c2ab4ff01e..fe5b858e069 100644 --- a/cfgov/v1/atomic_elements/molecules.py +++ b/cfgov/v1/atomic_elements/molecules.py @@ -566,3 +566,6 @@ class FeatureCard(blocks.StructBlock): class Meta: icon = "edit" template = "v1/includes/molecules/feature-card.html" + + class Media: + css = ["partially-styled-link.css"] diff --git a/cfgov/v1/jinja2/v1/includes/atoms/partially-styled-link.html b/cfgov/v1/jinja2/v1/includes/atoms/partially-styled-link.html deleted file mode 100644 index 230db3a8e38..00000000000 --- a/cfgov/v1/jinja2/v1/includes/atoms/partially-styled-link.html +++ /dev/null @@ -1,29 +0,0 @@ -{# ========================================================================== - - Partially styled link - - ========================================================================== - - Description: - - Create a partially underlined link atom when given: - - value: An object with the following options for value. - - value.url: A string for the URL of the link. - - value.plain_text: A string for the text of the link. - - value.underlined_text: A string for the underlined text of the link. - - ========================================================================== #} - -{% macro render(value) -%} - - - {{ value.plain_text|safe }} - {{ value.underlined_text }} - - -{%- endmacro %} -