• Stars
    star
    1,322
  • Rank 34,216 (Top 0.7 %)
  • Language
    Elm
  • License
    BSD 3-Clause "New...
  • Created over 6 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

What if you never had to write CSS again?

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.

Notes

Make sure to have <!DOCTYPE html> on top of your application; otherwise, things might get messed up in some browsers.

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.

More Repositories

1

style-elements

Create styles that don't mysteriously break!
HTML
446
star
2

elm-style-animation

The style animation library for Elm!
Elm
444
star
3

elm-markup

Elm-friendly markup
Elm
177
star
4

elm-codegen

Elm
133
star
5

elm-animator

A timeline-based animation engine for Elm
Elm
131
star
6

elm-optimize-level-2

Elm
125
star
7

stylish-elephants

This project has matured and been released! Go here ->
Elm
44
star
8

elm-animation-flower-menu

JavaScript
17
star
9

design-discussion-elm-ui-2

A repo for discussing changes to Elm UI 2
17
star
10

elm-dev

Haskell
17
star
11

atom-inline-messenger

Inline Messaging in the Atom Editor
CoffeeScript
14
star
12

mechanical-elephant-hakyll

mechanical-elephant.com
CSS
11
star
13

elm-color-mixing

Color mixing in elm!
Elm
9
star
14

elm-markup-cli

JavaScript
9
star
15

elm-skimmer

Browse elm packages and projects with metrics!
HTML
8
star
16

style-elements-design-discussion

8
star
17

elm-animation-pack

Easily manage your animation states in Elm!
Elm
6
star
18

elm-markup-vscode

Syntax Highlighting for .up files for `elm-markup`
JavaScript
6
star
19

Elmsmith

A Static Site Generator in Elm
HTML
5
star
20

kubernetes-starterkit

WARNING: not for use quite yet.
Python
5
star
21

elm-prefab

Maintainable code generation for Elm Apps
JavaScript
5
star
22

ui-animation

All Work from this Repo has been published at https://github.com/mdgriffith/elm-style-animation
Elm
5
star
23

elm-gql-github-example

An example repo for elm-gql that uses the Github GraphQL API
Elm
4
star
24

low-poly-background

CoffeeScript
4
star
25

drakon-anywhere

The Drakon Editor in a Docker container so it can run anywhere
Shell
4
star
26

elm-html-animation

DEPRECATED: Use https://github.com/mdgriffith/elm-style-animation if you're on elm 0.17
Elm
4
star
27

elm-path

UNDER CONSTRUCTION! Just a sketch at the moment :)
HTML
4
star
28

roam-notion-import

A script to help import files from notion to roam research
Rust
3
star
29

elm-debug-watch

Convenience functions to log the input and output of a function.
Elm
3
star
30

elm-color

Elm
3
star
31

elm-animation-talk

JavaScript
2
star
32

elm-all-docs

A cache of all the docs.json files on the Elm Package website
TypeScript
2
star
33

roc-tui

CSS
2
star
34

elm-style-elements-complex-example

DEPRECATED (This repo uses a much older version of style-elements)
HTML
1
star
35

site-selfie

Haskell
1
star
36

elm-style-elements-simple-example

DEPRECATED (This repo uses a much older version of style-elements)
Elm
1
star
37

language-guitar-tab

Syntax Highlighter for Guitar Tablature for the Atom Code Editor
CoffeeScript
1
star
38

elm-style-animation-zero-sixteen

elm-style-animation for elm 0.16 (This is generally deprecated, use elm-style-animation for elm 0.17 and above)
Elm
1
star
39

elm-ui-testing

A repo for tracking elm-ui testing results
HTML
1
star