From 8a072907f0e025fa3979c9e80ac83f0538d41dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kn=C3=B6pfle?= Date: Wed, 14 Dec 2022 11:06:33 +0100 Subject: [PATCH 1/2] =?UTF-8?q?[#96]=20Use=20u-height-stretch=20instead=20?= =?UTF-8?q?of=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …u-height-100vh in sidebar https://github.com/bitcrowd/bitstyles_phoenix/issues/96 --- CHANGELOG.md | 8 ++++++++ config/config.exs | 3 ++- demo/config/config.exs | 3 ++- demo/mix.exs | 3 ++- lib/bitstyles_phoenix.ex | 12 +++++++++++- lib/bitstyles_phoenix/alpine3/sidebar.ex | 2 +- lib/bitstyles_phoenix/bitstyles.ex | 5 +++++ lib/bitstyles_phoenix/component/sidebar.ex | 19 +++++++++++++++---- 8 files changed, 46 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca67716..c2a01a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +# Unreleased + +## Breaking + +- Sidebars use `u-height-strech` instead of `u-height-100vh`. This requires the project to run autoprefixer. + If you can't run autoprefixer in your project, set `config :bitstyles_phoenix, autoprefixer: false` to get the + old behaviour. + ## v2.1.1 - 2022-12-02 - Fixed version backwards compatibility diff --git a/config/config.exs b/config/config.exs index 6048e84..018da84 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,6 +1,7 @@ import Config config :bitstyles_phoenix, - trim_e2e_classes: [enabled: true] + trim_e2e_classes: [enabled: true], + autoprefixer: true config :phoenix, :json_library, Jason diff --git a/demo/config/config.exs b/demo/config/config.exs index 89919dd..1340f35 100644 --- a/demo/config/config.exs +++ b/demo/config/config.exs @@ -9,7 +9,8 @@ import Config config :bitstyles_phoenix, translate_errors: {BitstylesPhoenixDemoWeb.ErrorHelpers, :translate_error, []}, - icon_file: {BitstylesPhoenixDemoWeb.Endpoint, :static_path, ["/assets/images/icons.svg"]} + icon_file: {BitstylesPhoenixDemoWeb.Endpoint, :static_path, ["/assets/images/icons.svg"]}, + autoprefixer: false config :bitstyles_phoenix_demo, BitstylesPhoenixDemoWeb.Gettext, default_locale: "en", diff --git a/demo/mix.exs b/demo/mix.exs index 7fe8e43..48d9273 100644 --- a/demo/mix.exs +++ b/demo/mix.exs @@ -71,7 +71,8 @@ defmodule BitstylesPhoenixDemo.MixProject do ], bitstyles: [ "cmd mkdir -p priv/static/assets", - "cmd cp -R assets/node_modules/bitstyles/assets/* priv/static/assets" + "cmd cp -R assets/node_modules/bitstyles/assets/* priv/static/assets", + "cmd cp -R ../assets/logo.svg priv/static/assets/images/" ], "bitstyles.watch": [ "bitstyles", diff --git a/lib/bitstyles_phoenix.ex b/lib/bitstyles_phoenix.ex index 8ead341..9fd928d 100644 --- a/lib/bitstyles_phoenix.ex +++ b/lib/bitstyles_phoenix.ex @@ -53,10 +53,20 @@ defmodule BitstylesPhoenix do ```elixir config :bitstyles_phoenix, - bitstyles_version: "1.5.0" + bitstyles_version: "3.0.0" ``` Release candidate versions are currently not supported. + ### Autoprefixer + + Bitstyles phoenix will use some classes that require autoprefixer even for newer browers. + If you can't run autoprefixer for some reason (not recommended) you can set `autoprefixer: false` + to make bitstyles_phoenix only output classes that are well supported in recent browsers. + + ```elixir + config :bitstyles_phoenix, autoprefixer: false + ``` + ### Translating error messages Generated phoenix apps usally come with a helper for [translating error messages](https://github.com/phoenixframework/phoenix/blob/496123b66c03c9764be623d2c32b4af611837eb0/installer/templates/phx_web/views/error_helpers.ex#L23-L46) diff --git a/lib/bitstyles_phoenix/alpine3/sidebar.ex b/lib/bitstyles_phoenix/alpine3/sidebar.ex index d5b2153..34f259a 100644 --- a/lib/bitstyles_phoenix/alpine3/sidebar.ex +++ b/lib/bitstyles_phoenix/alpine3/sidebar.ex @@ -49,7 +49,7 @@ defmodule BitstylesPhoenix.Alpine3.Sidebar do ...> ...> """ """ -
+