kalkatfyodor

kalkatfyodor

I don’t understand the difference between phoenix.css and app.css. In app.css I have phx-something classes. Why aren’t they in the phoenix.css file? Why isn’t app.css blank for my custom styling?

To be honest I have no idea where should I put my custom CSS styling, phoenix.css or app.css?

Showing Posts 1 to 4

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

app.css

Phoenix code will apply those classes to various DOM elements automatically, like when a live view page disconnects. However, it’s up to you what it should look like when those classes are applied. Thus, since it is “custom code” of a sort, it goes in app.css. When you generate a new project, Phoenix generates a good default for you, just as it does with lots of other code.

kalkatfyodor

kalkatfyodor OP

Exactly. To me it doesn’t make sense at all. All phx-something alert-something classes should be in phoenix.css and app.css should be almost empty or perhaps have some basic styling.

The current setup is bad design and utterly confusing.

I have decided to ditch the phoenix.css file altogether and use only app.css but then I came to this error: From my 5 css files only app.css is being compiled to the static folder

LostKobrakai

LostKobrakai

phoenix.css is the styling used so code generated by the phoenix generators doesn’t look ****. If you don’t intend to use the default UI you can delete the whole file as is. The LV related classes in app.css are indendend to be kept even if you scrap the default UI. They’re meant to be updated, but not removed, given they’re essential for the UX of LV pages. No need to search phoenix.css for essential vs non-essential pieces of css.

I can see a case being made that the alert classes should be part of phoenix.css, but tbh I also just delete them once I don’t use them anymore, just like phoenix.css.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

It’s best to hand out such comments sparingly :slight_smile:

@LostKobrakai I think has done an excellent explanation here that really gets at the heart of the goal. A good example today would be Bulma. Bulma is a very popular javascript free CSS framework. If you want to use bulma in a phoenix project it’s super easy: just delete phoenix.css and add the core bulma files and you’re done.

Notably: app.css will still contain a phx-disconnected definition, why? Because this is still a class you need to have a definition for regardless of whether you’re using the phoenix styles or not.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews