Skip to content

Add "Purple Dark" theme#1144

Merged
laymonage merged 1 commit into
giscus:mainfrom
mystieneko:purpledark
Aug 19, 2023
Merged

Add "Purple Dark" theme#1144
laymonage merged 1 commit into
giscus:mainfrom
mystieneko:purpledark

Conversation

@mystieneko

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Aug 10, 2023

Copy link
Copy Markdown

@MystieHum is attempting to deploy a commit to the giscus Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread styles/themes/purpledark.css Outdated
--color-border-default: rgba(var(--bg-default), 0.85);
--color-border-muted: rgb(175 184 193 / 20%);
--color-neutral-muted: rgb(175 184 193 / 20%);
--color-accent-fg: rgba(var(--primary-default), 0.85);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, but this doesn't have enough colour contrast to pass accessibility checks:

colour contrast of 2.84 image

Could you use a different colour?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will look into that, thanks (didn't try with a and code tags)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

by the way, how to solve this CORS error? is it even related to giscus or am i doing something wrong? i try to use my theme like that:

data-theme="https://realvanyek.eu.org/css/giscus.css"

but it gives this error and my theme doesn't load:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://realvanyek.eu.org/css/giscus.css. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

@laymonage laymonage Aug 12, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You need to put a CORS header (Access-Control-Allow-Origin) to the response when hosting the CSS file on your website. How to do it depends on how your website is configured and hosted, but the goal is to make it so that when the browser requests the CSS file, the response includes the Access-Control-Allow-Origin header with a value that allows https://giscus.app (either explicitly or by wildcard *).

Example:
image

I think Vercel automatically adds Access-Control-Allow-Origin: * to static files. For Netlify, you'll have to specify it manually: https://docs.netlify.com/routing/headers/

If it's hosted on a server using Nginx, you need to update your Nginx config e.g. https://enable-cors.org/server_nginx.html (be careful to only allow CORS for paths that you explicitly want to be accessed from other websites though)

Other than that, it really depends on how your website is configured, but you can probably find a guide on how to do it with your setup.

@mystieneko

Copy link
Copy Markdown
Contributor Author

@laymonage does this look good now?

@vercel

vercel Bot commented Aug 19, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giscus ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2023 5:41pm

@laymonage laymonage left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @MystieHum, the new colour still didn't pass accessibility checks but I found a close enough colour that does – I had to use a hardcoded RGB value though. I've made a few other small tweaks and renamed the file from purpledark.css to purple_dark.css to better match the other themes. Thanks again!

@mystieneko

Copy link
Copy Markdown
Contributor Author

@laymonage no problem!

@m1cro-cat

Copy link
Copy Markdown

cool theme :)

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.

3 participants