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 manual embed width #3910

Merged
merged 2 commits into from
Mar 18, 2024
Merged

fix manual embed width #3910

merged 2 commits into from
Mar 18, 2024

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Mar 17, 2024

Changes

This PR fixes plausible/docs#470

Here's how it looks in bg-red-200 mx-auto max-w-md container
Screenshot 2024-03-18 at 07 50 30

And here's how it looks in bg-red-200 container

Screenshot 2024-03-18 at 07 52 35

And here's how it looks on master (where max-w-screen-xl was applied regardless of width=manual)

Screenshot 2024-03-18 at 07 53 49

Tests

  • This PR does not require tests

Changelog

  • Entry has been added to changelog

Documentation

  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode

@@ -42,7 +42,7 @@ defmodule PlausibleWeb.StatsView do

def stats_container_class(conn) do
cond do
conn.assigns[:embedded] && conn.assigns[:width] == "manual" -> ""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no such assign. I thought about adding it but was afraid that it's used someplace else in the template. So instead I'm just checking the params.

@@ -42,7 +42,7 @@ defmodule PlausibleWeb.StatsView do

def stats_container_class(conn) do
cond do
conn.assigns[:embedded] && conn.assigns[:width] == "manual" -> ""
conn.assigns[:embedded] && conn.params["width"] == "manual" -> "px-6"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still adding padding since it looks much nicer that way.

@ruslandoga ruslandoga marked this pull request as ready for review March 17, 2024 23:57
@ruslandoga ruslandoga requested a review from a team March 17, 2024 23:58
@zoldar zoldar merged commit 8c0e94f into master Mar 18, 2024
5 checks passed
@zoldar zoldar deleted the fix-manual-embed-width branch March 18, 2024 08:37
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.

Manual width mode does not work
2 participants