What if you never had to write CSS again?
Go to file
2024-06-23 15:43:48 -04:00
.github add label has-ellie for issues containing https://ellie-app.com/ 2020-04-29 18:22:44 +02:00
benchmarks bitfield benchmarks 2023-05-29 11:35:28 +01:00
examples Transition example updated 2024-02-10 08:46:34 -05:00
experiments font adjustment examples 2020-12-03 09:25:11 -05:00
notes remove clipX and clipY in favor of clipped 2020-06-08 09:51:10 -04:00
review update elm.json 2023-10-29 08:50:57 -04:00
src Fix padding override issue 2024-06-23 15:43:48 -04:00
stylesheets Remove unused class 2024-05-04 08:36:53 -04:00
tests add content alignment flags 2023-09-24 12:19:21 -04:00
tests-rendering More visual text input tests 2024-05-25 21:52:01 +01:00
.gitignore update to newest version of elm-animator 2021-10-09 11:00:03 -04:00
CONTRIBUTING.md Remove helpful projects 2020-02-12 12:41:58 +01:00
CSS-LOOKUP.md Update CSS-LOOKUP.md 2020-04-14 12:01:20 +02:00
docs.json Docs update 2024-04-26 17:31:19 -04:00
elm.json Add Ui.Prose 2023-08-11 17:09:24 -04:00
LICENSE update copyright 2020-03-12 21:09:20 -04:00
package.json Add elm-review 2023-10-29 08:47:58 -04:00
pnpm-lock.yaml Add elm-review 2023-10-29 08:47:58 -04:00
README.md clean up after flailing around a bit 2020-03-13 20:35:13 -04:00
yarn.lock Generate the flags file so we know exactly how many there are 2021-10-16 12:29:17 -04:00

Check out the talk that goes with the library, Building a Better Design Toolkit

A New Language for Layout and Interface

CSS and HTML are actually quite difficult to use when you're trying to do the layout and styling of a web page.

This library is a complete alternative to HTML and CSS. Basically you can just write your app using this library and (mostly) never have to think about HTML and CSS again.

The high level goal of this library is to be a design toolkit that draws inspiration from the domains of design, layout, and typography, as opposed to drawing from the ideas as implemented in CSS and HTML.

This means:

  • Writing and designing your layout and view should be as simple and as fun as possible.
  • Many layout errors (like you'd run into using CSS) are just not possible to write in the first place!
  • Everything should just run fast.
  • Layout and style are explicit and easy to modify. CSS and HTML as tools for a layout language are hard to modify because there's no central place that represents your layout. You're generally forced to bounce back and forth between multiple definitions in multiple files in order to adjust layout, even though it's probably the most common thing you'll do.

Try this live example on Ellie!

module Main exposing (..)

import Element exposing (Element, el, text, row, alignRight, fill, width, rgb255, spacing, centerY, padding)
import Element.Background as Background
import Element.Border as Border
import Element.Font as Font


main = 
    Element.layout []
        myRowOfStuff

myRowOfStuff : Element msg
myRowOfStuff =
    row [ width fill, centerY, spacing 30 ]
        [ myElement
        , myElement
        , el [ alignRight ] myElement
        ]


myElement : Element msg
myElement =
    el
        [ Background.color (rgb255 240 0 245)
        , Font.color (rgb255 255 255 255)
        , Border.rounded 3
        , padding 30
        ]
        (text "stylish!")

Join the Elm UI Slack!

First, if you have a question about how to do something with the library, join #elm-ui on the Elm Slack! There are usually a number of people who are willing to help out, myself included.

History

The work is based off of a rewrite of the Style Elements library. A lot of that work was originally released under the Stylish Elephants project.

Community Cookbook

The community around elm-ui is maintaining a collection of examples called the elm-ui-cookbook. If you are just starting out with elm-ui, or get stuck on specific things, this can be a great resource.

Contributing

Want to help out fixing bugs or reporting issues?

Please add issues you find, and if you want to verify code you want to contribute, please read how to run the tests here.