StylishThemes / Discourse-Dark

🏛️ Darken Discourse forums
https://openusercss.org/theme/5b455a48562a680b00b749db
Other
41 stars 13 forks source link

Embedded comments on other sites are being styled #18

Closed xt0rted closed 4 years ago

xt0rted commented 5 years ago

I'm thinking it might be good to exclude the embedded commenting url from styling since it messes up the look of the site it's being used on. It took me a bit to realize nothing was wrong here and they were using Discourse for the comments too.

image

<iframe src="https://community.home-assistant.io/embed/comments?embed_url=https%3A%2F%2Fwww.home-assistant.io%2Fblog%2F2018%2F12%2F27%2Fdata-science-portal%2F" id="discourse-embed-frame" width="100%" frameborder="0" scrolling="no" height="23745px"></iframe>
Mottie commented 5 years ago

I'm not sure what the best solution for this would be...

If I convert the domain('community.home-assistant.io') to regexp("https://community.home-assistant.io(?!/embed)/.*") then it will stop styling the embedded comments; but to fully implement this we'd need to change all the entries to use regexp.

xt0rted commented 5 years ago

@Mottie I realized that after I started looking through the stylesheet. I don't mind making the change but it feels kind of bloated since this is meant to run on many sites.

Instead of updating all sites, how about just those that are known to use the commenting feature? For now that'd be just this site.

I'm testing this and it seems to work.

^https://community\\.home-assistant\\.io/(?!embed/comments).*$

I'm not opposed to leaving it alone either. If it's too complex then it's not worth it.

Podesta commented 5 years ago

I know level1techs also use their discourse embedded for comments on the site. But personally, my solution there was different. Instead of removing the discourse embedded style, I made the site compliant with it.

the-j0k3r commented 4 years ago

I'll have a look at this convert to rexexp and exclude embeds

xt0rted commented 4 years ago

I don't use this style anymore so it doesn't matter to me if this change gets made or not.

the-j0k3r commented 4 years ago

This is pretty much a non issue now, maybe overdone the regex conversions in some domains but sod it, its done now.

Still cleanup in specific site area sis needed as followup.