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

fix: css styles applied & config page collapse #112

Merged
merged 7 commits into from
Mar 14, 2024
Merged

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Mar 14, 2024

Title

Fix css styles not being included in final assets & better config page handling

Description

  1. Fix css styles not being included in final assets
  2. Remove annoying issue where config page from main domain was always collapsed. It is now only collapsed by default when viewed from a subdomain.

fixes #111

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review

Comment on lines +18 to +23
it('has css file with expected content', async () => {
await expect(access(resolve(cwd, '../dist/ipfs-sw-styles.css'), constants.F_OK)).to.not.be.rejected()
const contents = await readFile(resolve(cwd, '../dist/ipfs-sw-styles.css'), 'utf8')
expect(contents).to.include('47vh')
expect(contents).to.include('.local-storage-toggle input.status')
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will likely want to remove this in the future but i'm going to leave it for now

Comment on lines +70 to +72
"sideEffects": [
"*.css"
]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed this to tell webpack about our css (tree splitting was ignoring css files because we told it we had no side effects..).

IIUC this is a webpack specific thing. see https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free

@SgtPooki SgtPooki marked this pull request as ready for review March 14, 2024 20:34
@SgtPooki SgtPooki merged commit 47b8af4 into main Mar 14, 2024
25 checks passed
@SgtPooki SgtPooki deleted the fix/css-imports branch March 14, 2024 20:40
@lidel lidel mentioned this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: css imports are not included in final assets
1 participant