Skip to content

Commit

Permalink
fix class name typo and include it in safelist (#2610)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Jan 20, 2023
1 parent 1a4b65c commit e3f095a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ module.exports = {
'./js/**/*.js',
'../lib/plausible_web/templates/**/*.html.eex',
],
safelist: [
// PlausibleWeb.StatsView.stats_container_class/1 uses this class
// it's not used anywhere else in the templates or scripts
"max-w-screen-lg"
],
darkMode: 'class',
theme: {
container: {
Expand Down
2 changes: 1 addition & 1 deletion lib/plausible_web/views/stats_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ defmodule PlausibleWeb.StatsView do
def stats_container_class(conn) do
cond do
conn.assigns[:embedded] && conn.assigns[:width] == "manual" -> ""
conn.assigns[:embedded] -> "max-width-screen-lg mx-auto"
conn.assigns[:embedded] -> "max-w-screen-lg mx-auto"
!conn.assigns[:embedded] -> "container"
end
end
Expand Down

0 comments on commit e3f095a

Please sign in to comment.