Giter Site home page Giter Site logo

surprisetalk / elm-bulma Goto Github PK

View Code? Open in Web Editor NEW
81.0 81.0 11.0 324 KB

Elm library for the Bulma front-end framework

Home Page: http://package.elm-lang.org/packages/surprisetalk/elm-bulma/latest

License: GNU General Public License v3.0

Elm 100.00%

elm-bulma's People

Contributors

ardenttech avatar glennular avatar jolandanava avatar surprisetalk avatar takmatsukawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elm-bulma's Issues

Example in README.md doesn't work

hey there ! beautiful project <3

In the read me you put this code

module Example exposing (..)

import Browser
import Bulma.CDN exposing (..)
import Bulma.Modifiers exposing (..)
import Bulma.Elements exposing (..)
import Bulma.Columns exposing (..)
import Bulma.Layout exposing (..)
import Html exposing ( Html, main_, text )

type alias Model = {}

main : Program () Model Msg
main
  = Browser.sandbox
    { init = {}
    , view = view
    , update = \msg -> \model -> model
    }

view : Model -> Html msg
view model 
  = main_ []
    [ stylesheet
    , exampleHero
    , exampleColumns
    ]

exampleHero : Html msg
exampleHero 
  = hero { heroModifiers | size = Medium, color = Primary } []
    [ heroBody []
      [ container []
          [ title H1 [] [ text "Hero Title" ]
          , title H2 [] [ text "Hero Subtitle" ]
          ]
      ]
    ]

exampleColumns : Html msg
exampleColumns 
  = section NotSpaced []
    [ container []
      [ columns columnsModifiers []
        [ column columnModifiers [] [ text "First Column" ]
        , column columnModifiers [] [ text "Second Column" ]
        , column columnModifiers [] [ text "Third Column" ]
        ]
      ]
    ]

elm complains that at line 13 main : Program () Model Msg Msg is not defined
Im a beginner at elm so i can't help ^^'

Fix package documentation for connectedFields

In the Elm package documentation, the example code for the connectedFields function specifies fields rather than connectedFields.

Currently:

myFields : Html msg
myFields
  = fields Centered []
    [ controlInput myControlInputModifiers [] [] [] 
    , control myControlModifiers []
      [ button myButtonModifiers [] []
      ]
    ]

Should be:

myFields : Html msg
myFields
  = connectedFields Centered []
    [ controlInput myControlInputModifiers [] [] [] 
    , control myControlModifiers []
      [ button myButtonModifiers [] []
      ]
    ]

Demo Site

I have been playing around with Elm and wanted to use using elm-bulma after migrating away from elm-mdl.

I had found the demo site to be very helpful at elm-mdl (https://debois.github.io/elm-mdl)

I started to build one for elm-bulma, and wanted you thought of this before i built out more and created a PR.

you can view the initial site: https://glennular.github.io/elm-bulma/demo/index.html
code: https://github.com/glennular/elm-bulma/tree/master/demo

Ideally there would be more examples that are model based. I haven't extended out the model to each sub page yet.

I wanted to mirror the Buma doc page (https://bulma.io/documentation/overview/start/)

This may be helpful as the new version that you are working on is being built/tested.

Improve function consistency

I'd like to make functions more predictable. In this library, I feel like it's a bit hard to remember what each function expects.
I'm thinking of "forcing" each function to be of the type modifiers -> List (Attribute msg) -> List (Html msg) -> Html msg.
Let me know what you think!

Remove `elm-bulma-classes` dependency

Unfortunately, elm-bulma-classes is no longer being maintained.
I'm thinking that we should make an equivalent, either in this package or a separate one.
We're open to suggestions!

Make modifiers easier to use

In this library, we have a lot of different modifiers! I'd like to make them simpler and/or easier to use.
Let me know if you have any suggestions!

Form.controlSelect and Small size

I wrote like below.

controlSelect { controlSelectModifiers | size = Small } [] []
              [ option [] [ text "Dropdown" ]
              ]

It generate:

<p class="control">
  <span class="select">
    <select class="is-small   ">
      <option>Dropdown</option>
    </select>
  </span>
</p>

But should be:

<p class="control">
  <span class="select is-small">
    <select>
      <option>Dropdown</option>
    </select>
  </span>
</p>

Why is there no `Width12` in Width type?

Hi
Currently, Width type has Auto , Width1 ~ Width11 .
However, Bulma supports is-12 . Why is there no Width12 in Width type?
Please tell me if there is a workaround you do not need.

Remove the "easy" functions

I like the "easy" functions, I'm thinking that they'd be better as snippets within the documentation for each function. That way, people can copy/paste easily, and edit the examples as they wish.
In the meantime, I'd love to hear people's opinions! Should we keep them or remove them?

adding our SASS customisation

Thanks for the great effort to bring this project up,

I have been looking for something like this for ages. Is there a possibility to add our own SAAS customization in order to generate new template flavor? what are the guides?

<a> elements without `href` cause page reloads with `Browser.application` in Elm 0.19

This is because "empty" links will cause a UrlRequest with Browser.External "".

My solution is to pattern match on this and just do nothing. You'll most likely pattern match on the UrlRequest anyway to get at the contents of it, so it's a small change, but not terribly obvious. So it might be a good idea to warn of this in the documentation.

Unless there are better solutions that can be implemented in the library to avoid the user dealing with this entirely, but I do not think there is.

a little issue with NavbarDropdown

There is a css / javascrpt interfering with the dropdown. I can't click to activate the drop down menu.

can you please have a look?

module Main exposing (..)

import Browser
import Bulma.CDN exposing (..)
import Bulma.Columns exposing (..)
import Bulma.Components exposing (..)
import Bulma.Elements exposing (..)
import Bulma.Layout exposing (..)
import Bulma.Modifiers exposing (..)
import Html exposing (Html, img, main_, span, text)
import Html.Attributes exposing (src)

type alias Model = {}

main : Program () Model msg
main
  = Browser.sandbox
    { init = {}
    , view = view
    , update = \msg -> \model -> model
    }

view : Model -> Html msg
view model
  = main_ []
    [ stylesheet
    , myHero
    ]



myNavbarBurger : Html msg
myNavbarBurger
  = navbarBurger False []
    [ span [] []
    , span [] []
    , span [] []
    ]

myNavbarLink : Html msg
myNavbarLink
  = navbarLink []
    [ text "More Junk"
    ]

myNavbar : Bool -> Bool -> Html msg
myNavbar isMenuOpen isMenuDropdownOpen
  = navbar navbarModifiers []
    [ navbarBrand [] myNavbarBurger
      [ navbarItem True []
        [ img [ src "https://bulma.io/images/bulma-logo.png" ] []
        ]
      ]
    , navbarMenu isMenuOpen []
      [ navbarStart []
        [ navbarItemLink False [] [ text "Home"  ]
        , navbarItemLink False [] [ text "Blog"    ]
        , navbarItemLink True  [] [ text "Carrots" ]
        , navbarItemLink False [] [ text "About"   ]
        ]
      , navbarEnd []
        [ navbarItemDropdown isMenuDropdownOpen Down [] myNavbarLink
          [ navbarDropdown True Left []
            [ navbarItemLink False [] [ text "Crud"     ]
            , navbarItemLink False [] [ text "Detritus" ]
            , navbarItemLink True  [] [ text "Refuse"   ]
            , navbarItemLink False [] [ text "Trash"    ]
            ]
          ]
        ]
      ]
    ]



exampleHero : Html msg
exampleHero
  = hero { heroModifiers | size = Medium, color = Primary } []
    [ heroBody []
      [ container []
          [ title H1 [] [ text "Hero Title" ]
          , title H2 [] [ text "Hero Subtitle" ]
          ]
      ]
    ]

exampleColumns : Html msg
exampleColumns
  = section NotSpaced []
    [ container []
      [ columns columnsModifiers []
        [ column columnModifiers [] [ text "First Column" ]
        , column columnModifiers [] [ text "Second Column" ]
        , column columnModifiers [] [ text "Third Column" ]
        ]
      ]
    ]




myHeroModifiers : HeroModifiers
myHeroModifiers
  = { bold  = False
    , size  = Large
    , color = Primary
    }

myHero : Html msg
myHero
  = easyHero myHeroModifiers []
    { head = heroHead [] [myNavbar True False]
    , body = heroBody [] [text "head"]
    , foot = heroFoot [] [text "head"]
    }

Consider Exposing Bulma.Classes

Currently, we have a messy module called Bulma.Classes.
With a little documentation and organization, it could be published alongside the other modules.

Let me know if there's any interest in using this package, and I'll clean it up and publish it!

Hero layout and Small size

The hero layout with a modifier with a size Small is generate without is-small class.

In src/Bulma/Layout.elm#L373

Currently:

hero : HeroModifiers -> List (Attribute msg) -> List (HeroPartition msg) -> Hero msg
hero {bold,size,color}
....
    , case size of
        Small    -> B.none
....

Should be:

hero : HeroModifiers -> List (Attribute msg) -> List (HeroPartition msg) -> Hero msg
hero {bold,size,color}
....
    , case size of
        Small    -> B.isSmall
....

Reason for anchors as buttons

I noticed it was very intentional in d3cf314, but why did this happen? Obviously you had something in mind so I might just be missing something.

Mainly, I keep encountering #17 which is easily work-around-able, but with a button tag it wouldn't even be an issue in a lot of cases.

Thanks for the great work! I love the library so far.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.