Skip to content

Commit

Permalink
Small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirlogachev committed May 4, 2024
1 parent 514be92 commit cbfa403
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
3 changes: 2 additions & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"version": "1.0.0",
"exposed-modules": [
"ExtraColor",
"Util.InlineStyle"
"Typography",
"InlineStyle"
],
"elm-version": "0.19.1 <= v < 0.20.0",
"dependencies": {
Expand Down
24 changes: 9 additions & 15 deletions example/src/Pages/Home_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Page exposing (Page)
import Route exposing (Route)
import Shared
import TextStyle
import Util.InlineStyle
import View exposing (View)


Expand Down Expand Up @@ -48,6 +47,7 @@ color2 : ExtraColor
color2 =
ExtraColor.oklchPercent 72.75 0.181 229.1


color3 : ExtraColor
color3 =
ExtraColor.oklchPercent 83.93 0.336 147.57
Expand All @@ -58,11 +58,6 @@ color4 =
ExtraColor.oklchPercent 91.28123 0.208 102.04


color5 : ExtraColor
color5 =
ExtraColor.oklchPercent 32.17 0.151 330.75


pageTitle : String
pageTitle =
"elm-ui toolkit"
Expand All @@ -88,30 +83,29 @@ viewMobile layout =
, spacing layout.grid.gutter
]
([ paragraph TextStyle.header [ text pageTitle ]
, paragraph [] [ text "Browsers will display a similar color anyway, even if it's not supported by the display. The fallbadck color is here only for the old browsers." ]
, paragraph [] [ text "Browsers will display a similar color anyway, even if it's not supported by the display. The fallbadck color is here only for the old browsers." ]
, gridRow layout
[ gridColumn layout { widthSteps = 2 } [ Font.color Color.white ] [ text "OKLCH" ]
, gridColumn layout { widthSteps = 2 } [ Font.color Color.white ] [ text "RGB fallback" ]
]
]

++ List.map (viewColor layout) [ color1, color2, color3, color4 ]
)


viewColor : LayoutState -> ExtraColor -> Element msg
viewColor layout c =
gridRow layout
[gridBox layout
[ gridBox layout
{ widthSteps = 6, heightSteps = 2 }
[ ]
[paragraph [Font.alignRight] [text <| ExtraColor.toCssString c ]]
, gridBox layout
[]
[ paragraph [ Font.alignRight ] [ text <| ExtraColor.toCssString c ] ]
, gridBox layout
{ widthSteps = 2, heightSteps = 2 }
[ ExtraColor.backgroundColor c ]
[ ]
[ ExtraColor.backgroundColor c ]
[]
, gridBox layout
{ widthSteps = 2, heightSteps = 2 }
[ Background.color (ExtraColor.toRgba c) ]
[ ]
[]
]
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "elm-ui-extra-colors",
"name": "elm-ui-toolkit",
"version": "1.0.0",
"description": "",
"private": true,
Expand Down
13 changes: 9 additions & 4 deletions review/src/ReviewConfig.elm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ import Review.Rule as Rule exposing (Rule)
import Simplify


packageExposedModules : List String
packageExposedModules =
[ "src/ExtraColor.elm", "src/Typography.elm", "src/InlineStyle.elm" ]


config : List Rule
config =
[ NoDebug.Log.rule
Expand All @@ -48,11 +53,11 @@ config =
, NoMissingSubscriptionsCall.rule
, NoRecursiveUpdate.rule
, NoUselessSubscriptions.rule
, NoUnsafeDivision.rule |> Rule.ignoreErrorsForFiles [ "src/ExtraColor.elm" ]
, NoUnused.CustomTypeConstructors.rule [] |> Rule.ignoreErrorsForFiles [ "src/ExtraColor.elm" ]
, NoUnused.CustomTypeConstructorArgs.rule |> Rule.ignoreErrorsForFiles [ "src/ExtraColor.elm" ]
, NoUnsafeDivision.rule |> Rule.ignoreErrorsForFiles packageExposedModules
, NoUnused.CustomTypeConstructors.rule [] |> Rule.ignoreErrorsForFiles packageExposedModules
, NoUnused.CustomTypeConstructorArgs.rule |> Rule.ignoreErrorsForFiles packageExposedModules
, NoUnused.Dependencies.rule
, NoUnused.Exports.rule |> Rule.ignoreErrorsForFiles [ "src/ExtraColor.elm" ]
, NoUnused.Exports.rule |> Rule.ignoreErrorsForFiles packageExposedModules
, NoUnused.Modules.rule
, NoUnused.Parameters.rule
, NoUnused.Patterns.rule
Expand Down
2 changes: 1 addition & 1 deletion src/ExtraColor.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module ExtraColor exposing

import Culori
import Element exposing (..)
import Util.InlineStyle as InlineStyle exposing (InlineStyle)
import InlineStyle exposing (InlineStyle)



Expand Down
2 changes: 1 addition & 1 deletion src/Util/InlineStyle.elm → src/InlineStyle.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Util.InlineStyle exposing (InlineStyle, render)
module InlineStyle exposing (InlineStyle, render)

import Element exposing (..)
import Html.Attributes
Expand Down

0 comments on commit cbfa403

Please sign in to comment.