Skip to content

Commit

Permalink
more styling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmavis committed May 3, 2024
1 parent 54980e1 commit dfbf7b3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load wagtailcore_tags wagtailadmin_tags %}

{% fragment as base_styles %}tw-gap-y-8 tw-mb-8 xlarge:tw-mb-0{% endfragment %}
{% fragment as base_styles %}tw-gap-y-8{% endfragment %}
{% fragment as desktop_layout %}{% endfragment %}
{% fragment as padding_for_hover %}xlarge:tw-p-4{% endfragment %}

Expand Down
50 changes: 26 additions & 24 deletions network-api/networkapi/templates/fragments/blocks/nav/dropdown.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load static wagtailcore_tags wagtailadmin_tags nav_tags %}

{% fragment as content_base_styles %}tw-container tw-overflow-y-auto tw-transition-all tw-duration-500 xlarge:tw-max-w-[1200px]{% endfragment %}
{% fragment as content_base_styles %}tw-overflow-y-auto tw-transition-all tw-duration-500 tw-bg-white xlarge:tw-bg-transparent xlarge:tw-max-w-[1200px]{% endfragment %}
{% fragment as dropdown_selector_base %}tw-container tw-flex tw-flex-row tw-items-center tw-justify-between tw-w-full tw-py-12 tw-px-8 tw-gap-4{% endfragment %}

{% fragment as content_desktop %}xlarge:tw-px-0 xlarge:tw-hidden{% endfragment %}
Expand Down Expand Up @@ -28,31 +28,33 @@ <h5 class="tw-m-0 {{ title_base_typography }} {{ title_desktop_typography }} {{
</div>

<div class="{{ content_base_styles }} {{ content_desktop_positioning }} {{ content_desktop }} {{ alignment_class }}" data-accordion-content>
<div class="{% block content_width %} xlarge:tw-w-{{ value.ncols }}/4 {% endblock content_width %} {{ content_desktop_border }}">
<div class="tw-nav-accordion-content-inner {% block grid_columns %} xlarge:tw-grid-cols-{{ value.ncols }} {% if value.has_featured_column %}tw-has-featured-column{% endif %}{% endblock grid_columns %}">
{% block content %}
{% if value.has_overview %}
{% include_block value.overview_value with button=value.button %}
<div class="tw-container">
<div class="{% block content_width %} xlarge:tw-w-{{ value.ncols }}/4 {% endblock content_width %} {{ content_desktop_border }}">
<div class="tw-nav-accordion-content-inner {% block grid_columns %} xlarge:tw-grid-cols-{{ value.ncols }} {% if value.has_featured_column %}tw-has-featured-column{% endif %}{% endblock grid_columns %}">
{% block content %}
{% if value.has_overview %}
{% include_block value.overview_value with button=value.button %}
{% endif %}
{% for column in value.columns %}
{% include_block column %}
{% endfor %}
{% if value.has_featured_column %}
{% include_block value.featured_column_value %}
{% endif %}
{% endblock content %}
</div>
{% block full_span_button %}
{% comment %}
If there is a button but no overview, we want to render the button at the bottom
of the dropdown. Otherwise it will be rendered together with the overview.
{% endcomment %}
{% if value.button and not value.has_overview %}
<div class="tw-w-full">
{% include_block value.button with style="primary-full-width" %}
</div>
{% endif %}
{% for column in value.columns %}
{% include_block column %}
{% endfor %}
{% if value.has_featured_column %}
{% include_block value.featured_column_value %}
{% endif %}
{% endblock content %}
{% endblock full_span_button %}
</div>
{% block full_span_button %}
{% comment %}
If there is a button but no overview, we want to render the button at the bottom
of the dropdown. Otherwise it will be rendered together with the overview.
{% endcomment %}
{% if value.button and not value.has_overview %}
<div class="tw-w-full">
{% include_block value.button with style="primary-full-width" %}
</div>
{% endif %}
{% endblock full_span_button %}
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load wagtailcore_tags wagtailadmin_tags %}

{% fragment as base_styles %}tw-gap-14 tw-bg-gray-02 tw-rounded-2xl tw-mb-8 xlarge:tw-mb-0{% endfragment %}
{% fragment as base_styles %}tw-gap-14 tw-bg-gray-02 tw-rounded-2xl{% endfragment %}
{% fragment as desktop_layout %}xlarge:tw-rounded-none xlarge:tw-col-span-1{% endfragment %}

<div class="tw-nav-dropdown-column tw-featured-column {{ base_styles }} {{ desktop_layout }}">
Expand Down
1 change: 1 addition & 0 deletions tailwind-plugins/site-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function shared(theme) {
flexDirection: "column",
alignItems: "start",
flex: "1",
marginBottom: theme("margin.8"),
[media(theme("screens.xlarge"))]: {
marginTop: theme("margin.22"),
marginBottom: theme("margin.22"),
Expand Down

0 comments on commit dfbf7b3

Please sign in to comment.