Skip to content

Commit

Permalink
Fix loading style (#1073)
Browse files Browse the repository at this point in the history
The style in index.html was getting ripped off on the instance level. I
am not sure why this does not happen on ui level 🤔 But opening the fix
since the current state is a blocker.

Please look at this pr:
NASA-IMPACT/veda-config#424 to see how it looks
like on the instance level.
  • Loading branch information
hanbyul-here authored Jul 30, 2024
2 parents fc9035d + 5f21b87 commit 6b96579
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
visibility: hidden;
}

.loading {
.welcome-banner-loading {
margin-top: 2rem;
opacity: 0.64;
}
Expand Down Expand Up @@ -114,7 +114,7 @@
-->
<h1>{{appTitle}}</h1>
<p>{{appDescription}}</p>
<p class='loading'>Loading...</p>
<p class='welcome-banner-loading'>Loading...</p>
</div>
</div>

Expand Down
25 changes: 21 additions & 4 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
const path = require('path');
const fs = require('fs-extra');
const CWD = process.cwd();

const vedaPath = path.resolve(CWD, '.veda/ui');
const isVedaInstance = fs.existsSync(vedaPath);

let uswdsPath = path.resolve(CWD, 'node_modules/@trussworks/react-uswds/lib');

if (isVedaInstance)
uswdsPath = path.resolve(
CWD,
'.veda/ui',
'node_modules/@trussworks/react-uswds/lib'
);

const contentPaths = isVedaInstance
? ['.veda/ui/app/**/*.{js,jsx,ts,tsx}', `${uswdsPath}/index.css`]
: ['./app/**/*.{js,jsx,ts,tsx}', `${uswdsPath}/index.css`];

let plugins = [require('autoprefixer'), require('postcss-import')];
const purge = require('@fullhuman/postcss-purgecss')({
content: [
'./app/**/*.{js,jsx,ts,tsx}',
'@trussworks/react-uswds/lib/index.css'
],
content: contentPaths,
safelist: {
deep: [/usa-banner$/],
greedy: [/^usa-banner/]
Expand Down

0 comments on commit 6b96579

Please sign in to comment.