Skip to content

Instantly share code, notes, and snippets.

View mdgriffith's full-sized avatar

Matthew Griffith mdgriffith

View GitHub Profile
-- in Ui.elm
image :
List (Attribute msg)
->
{ source : String
, description : String
}
module Internal.BitField exposing
( init, Bits, toString
, BitField, field
, set, setPercentage
, get, getFloat, getPercentage
, has, equal
, clear, merge
)
{-|
module Ui.Table exposing
( Column, column, header, withWidth, withStickyColumn
, view, Config, columns
, withRowKey, onRowClick, withStickyHeader, withStickyRow, withScrollable
, viewWithState
, columnWithState, withVisibility, withOrder
, withSort
)
{-|
{- A sketch for a potential responsive API for elm-ui
First, the API. Following will be some example code!
-}
-- defining a set of global window-width breakpoints
breakpoints : label -> List (Breakpoint label) -> Breakpoints label
var $author$project$Internal$Model2$element = F3(
function (layout, attrs, children) {
return function (parentEncoded) {
return $author$project$Internal$Model2$renderAttrs(parentEncoded)(layout)($author$project$Internal$Model2$emptyDetails)(children)($author$project$Internal$Flag2$none)(_List_Nil)(
$author$project$Internal$Model2$contextClasses(layout))($author$project$Internal$Model2$NoNearbyChildren)('')(
$elm$core$List$reverse(attrs));
};
});
var $author$project$Internal$Model2$renderAttrs = function (parentEncoded) {
@mdgriffith
mdgriffith / Instructions.md
Last active July 30, 2019 22:35
Elm UI Performance Mode

There's a new Elm performance mode.

If you’re still interested in trying it out, here’s how to ge it working.

  1. clone the elm-ui repo locally and point your source-directories to it.
    • You can make sure to checkout the commit for the latest release (1.1.1) in order to avoid pulling unpublished changes
  2. Enable the virtual css in elm land via
import Internal.Model as Internal
@mdgriffith
mdgriffith / Input.Select.elm
Last active April 23, 2019 11:10
How to manually construct a select menu in Style Elements.
module SelectMenu exposing (..)
import Element exposing (..)
import Element.Input as Input
import Element.Font as Font
import Dom
import Color exposing (..)
{-
Inline Style Definitions
Style classes would be calculated as a hash of the style properties. Styles are bubbled up into a stylesheet.
-}
{-
Form elements could use some love as far as standardizing how they work.
Every form element has the following in common:
- a value (except button)
- a change event
- a label
- style
- label content
We can have every form input generate an `Input` type that can only be converted to an `Element` through labeling.
{- It might be nice to have a few "premade" layouts.
These would be semantic elements that have an implied, but specific layout.
-}
footer -- <footer>, always rendered as a `row layout`
sidebar -- <aside> ?, always renderd as a column
navbar -- <nav>, always rendered as a row layout with `justify`?