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

Discuss #25

Open
kentcdodds opened this issue Jul 1, 2021 · 4 comments
Open

Discuss #25

kentcdodds opened this issue Jul 1, 2021 · 4 comments
Milestone

Comments

@kentcdodds
Copy link
Owner

#19 (comment)

Gotta run, but wanted to make sure we don't forget to address this:

Regarding the candy dispenser, do a lot of posts have embedded jsx/html? We could adjust the prose classes to either do something with embedded html, or attempt to not target it entirely. But I feel like content like that should be positioned in an iframe, with its own styling.

Otherwise, we'll always have the chance of missing some (edge) cases.

The transparent png at /blog/unit-vs-integration-vs-e2e-tests can easily be fixed by adding a light background color to .prose img to simulate the effect of the current site (transparent on white), but not sure if that has your preference, because then you'll lose the benefit of transparent images.

Thoughts?

@kentcdodds
Copy link
Owner Author

What's tricky is we can't rely on tailwind in the posts because the posts aren't built with the site so tailwind may be out of date relative to the posts. However, there could probably be a few "components" that we could style to look nicely.

One good example of this is a callout component similar to remix's docs info component:

image

image

So we could probably have something like a <inline-demo> element that we style in a special way.

For that specific transparent image... I think I just need to change it. It's weird.

@kentcdodds
Copy link
Owner Author

This post needs work: https://kent.dev/blog/usememo-and-usecallback

The candy dispenser needs looking into and the date switches from June 4th (server rendered) to June 3rd (client rendered).

@smeijer
Copy link
Collaborator

smeijer commented Sep 3, 2021

the date switches from June 4th (server rendered) to June 3rd (client rendered).

Sounds like a timezone thing. Your server is probably running in a different timezone than the user's browser. You can current that using timezoneOffset:

import format from 'date-fns/format';
import add from 'date-fns/add';

const offset = new Date().getTimezoneOffset();

format(
  // assuming the server sends date in UTC
  add(frontmatter.date, { minutes: offset }), 
  '...'
);

@kentcdodds
Copy link
Owner Author

Nice! Thanks for that. I used exactly that 👍

kentcdodds added a commit that referenced this issue Sep 4, 2021
@kentcdodds kentcdodds added this to the Post-launch milestone Sep 21, 2021
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

No branches or pull requests

2 participants