Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WP-197 use @layer's / help migrate Frontera #856

Merged
merged 14 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ SRC: https://bitbucket.org/taccaci/frontera/src/master/client/css/bootstrap.min.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */

/* Wrapped by TACC (start) */
/* FAQ: To NOT apply to header nor footer */
/* FAQ: To NOT increase spcificity */
:where(main) {

/* … */

b,
Expand Down Expand Up @@ -83,11 +88,15 @@ button[disabled],
html input[disabled] {
cursor:default
}
/* Disabled by TACC */
/* FAQ: The `-moz-focus-inner` breaks CSS nesting */
/*
button::-moz-focus-inner,
input::-moz-focus-inner {
border:0;
padding:0
}
*/
input {
line-height:normal
}
Expand Down Expand Up @@ -136,6 +145,9 @@ th {
padding:0
}

/* Wrapped by TACC (end) */
}

/* … */

html {
Expand All @@ -151,6 +163,11 @@ body {
color:#222222;
}

/* Wrapped by TACC (start) */
/* FAQ: To NOT apply to header nor footer */
/* FAQ: To NOT increase spcificity */
:where(main) {

/* … */

a {
Expand Down Expand Up @@ -449,3 +466,6 @@ table {
}

/* … */

/* Wrapped by TACC (end) */
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* TACC v3 site.css Overrides
*/

/* To restore ../bootstrap.3.3.7.css margin-top */
/* To overwrite Core CMS v3.10 Core-Styles v0.11+ */
/* To restore ../bootstrap.3.3.7.css `margin-top` */
/* FAQ: Overrides Core CMS v3.10 Core-Styles v0.11+ */
/* https://github.com/TACC/Core-Styles/blob/v0.13.0/src/lib/_imports/elements/html-elements.cms.css#L92-L95 */
h1 + h2,
h1 + hr {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TACC CMS - Stylesheets - Migrations - v4.17 to v4.18

This is a migration:

- from **not** using CSS layers
- to using CSS layers
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* To fix layout of elements in CSS header */
/* FAQ: The `site.css` in `layer(project.core)` overwrites Bootstrap `_navbar.scss` in `layer(foundation)`. This causes `site.css` <ul> `padding-left: 0` to overwrite Bootstrap */
.navbar-nav {
padding-left: 0;
}

/* To not rely on Bootstrap `.nav-link:hover` */
/* FAQ: Because Bootstrap can be reverted or not loaded */
/* FAQ: Overrides site.css `a:hover` */
#s-header .nav-link,
#s-header .nav-link > a {
text-decoration: none !important; /* to override even if within lower layer */
}
18 changes: 12 additions & 6 deletions taccsite_cms/templates/assets_site.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@

<!-- Site Assets: Styles. -->

<!-- TODO: Use same version of Bootstrap as TACC/Core-Portal (v4.3.1) -->
<link id="css-bootstrap" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>
{# https://tacc-main.atlassian.net/wiki/x/hRlv #}
@layer foundation, /* @base, */ project;

<link id="css-site" rel="stylesheet" href="{% static 'site_cms/css/build/site.css' %}">
<link id="css-site-header" rel="stylesheet" href="{% static 'site_cms/css/build/site.header.css' %}">
{# CAVEAT: Requires `npm run build:css` step #}
<link id="css-site-v3-11+" rel="stylesheet" href="{% static 'site_cms/css/build/site.v3-11-plus.css' %}">
/* TODO: Use same version of Bootstrap as TACC/Core-Portal (v4.3.1) */
@import url("https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css") layer(foundation);

@import url("{% static 'site_cms/css/build/site.css' %}") layer(project.core);
@import url("{% static 'site_cms/css/build/site.header.css' %}") layer(project.core);

@import url("{% static 'site_cms/css/build/site.v3-11-plus.css' %}") layer(project.core);
@import url("{% static 'site_cms/css/build/site.layer-fixes.css' %}") layer(project.core);
</style>


{# Impacts the clients "CEPv2" Portal & Frontera Docs #}
Expand Down
4 changes: 3 additions & 1 deletion taccsite_cms/templates/djangocms_blog/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
{# /TACC #}

{% if settings.TACC_CORE_STYLES_VERSION == 0 %}
<link rel="stylesheet" href="{% static 'site_cms/css/build/site.app.blog.css' %}">
<style>
@import url("{% static 'site_cms/css/build/site.app.blog.css' %}") layer(project.core);
</style>
{% elif settings.TACC_CORE_STYLES_VERSION >= 1 %}
<style>
@import url("{% static 'site_cms/css/build/app.blog.css' %}") layer(project);
Expand Down