diff --git a/src/Css.elm b/src/Css.elm index c3812b72..e5ae85e3 100644 --- a/src/Css.elm +++ b/src/Css.elm @@ -68,6 +68,7 @@ module Css exposing , animationIterationCount , FontSize, ColorValue, ColorStop, IntOrAuto , thin, thick, blink + , borderInlineEndColor, borderInlineStartColor, borderTopWidth2, mixed, sideways, textDecorationColor, upperGreek, upright ) {-| Define CSS styles in Elm. @@ -481,7 +482,7 @@ deprecated or discouraged. import Css.Animations exposing (Keyframes) import Css.Internal exposing (getOverloadedProperty, lengthConverter, lengthForOverloadedProperty) -import Css.Preprocess as Preprocess exposing (Style, unwrapSnippet) +import Css.Preprocess as Preprocess exposing (Style) import Css.String import Css.Structure as Structure exposing (..) import Hex @@ -896,6 +897,7 @@ type alias TableLayout compatible = almostPct100 = calc (pct 100) minus (px 2) + -- calc(100vh - (2px + 2rem)) screenMinusBorderAndFooter = calc (vh 100) minus (calc (px 2) plus (rem 2)) @@ -968,22 +970,6 @@ minus = Subtraction -combineLengths : - (Float -> Float -> Float) - -> { r | numericValue : Float, unitLabel : String, value : String } - -> { r | numericValue : Float, unitLabel : String, value : String } - -> { r | numericValue : Float, unitLabel : String, value : String } -combineLengths operation firstLength secondLength = - let - numericValue = - operation firstLength.numericValue secondLength.numericValue - - value = - String.fromFloat numericValue ++ firstLength.unitLabel - in - { firstLength | value = value, numericValue = numericValue } - - {-| -} type alias LengthOrAuto compatible = @@ -7665,11 +7651,6 @@ blink = IntentionallyUnsupportedPleaseSeeDocs -stringToInt : String -> Int -stringToInt str = - Maybe.withDefault 0 <| String.toInt str - - numericalPercentageToString : Float -> String numericalPercentageToString value = String.fromFloat (value * 100) ++ "%" diff --git a/src/Css/Animations.elm b/src/Css/Animations.elm index 03c1c58a..9ffd2975 100644 --- a/src/Css/Animations.elm +++ b/src/Css/Animations.elm @@ -23,8 +23,7 @@ Some of the animatable properties (except for experimental properties, or proper -} -import Css.Internal exposing (AnimationProperty(..), ColorValue, ExplicitLength, Length, LengthOrAutoOrCoverOrContain, lengthConverter, lengthForOverloadedProperty) -import Css.Preprocess as Preprocess +import Css.Internal exposing (AnimationProperty(..), Length, LengthOrAutoOrCoverOrContain) import Css.String import Css.Structure exposing (Compatible(..)) @@ -40,10 +39,6 @@ type alias Property = AnimationProperty -type alias Style = - Preprocess.Style - - {-| -} type alias Keyframes compatible = { compatible | keyframes : Compatible, none : Compatible, value : String } diff --git a/src/Css/Internal.elm b/src/Css/Internal.elm index 6e1c9b2b..9e58a342 100644 --- a/src/Css/Internal.elm +++ b/src/Css/Internal.elm @@ -117,13 +117,13 @@ getOverloadedProperty functionName desiredKey style = -- Use the given style's Key as the resulting property's value. property desiredKey key - Preprocess.ExtendSelector selector _ -> + Preprocess.ExtendSelector _ _ -> property desiredKey ("elm-css-error-cannot-apply-" ++ functionName ++ "-with-inapplicable-Style-for-selector") - Preprocess.NestSnippet combinator _ -> + Preprocess.NestSnippet _ _ -> property desiredKey ("elm-css-error-cannot-apply-" ++ functionName ++ "-with-inapplicable-Style-for-combinator") - Preprocess.WithPseudoElement pseudoElement _ -> + Preprocess.WithPseudoElement _ _ -> property desiredKey ("elm-css-error-cannot-apply-" ++ functionName ++ "-with-inapplicable-Style-for-pseudo-element setter") Preprocess.WithMedia _ _ -> @@ -138,7 +138,7 @@ getOverloadedProperty functionName desiredKey style = Preprocess.ApplyStyles (only :: []) -> getOverloadedProperty functionName desiredKey only - Preprocess.ApplyStyles (first :: rest) -> + Preprocess.ApplyStyles (_ :: rest) -> getOverloadedProperty functionName desiredKey (Preprocess.ApplyStyles rest) diff --git a/src/DEPRECATED/Css/File.elm b/src/DEPRECATED/Css/File.elm deleted file mode 100644 index b25eb39d..00000000 --- a/src/DEPRECATED/Css/File.elm +++ /dev/null @@ -1,142 +0,0 @@ -module DEPRECATED.Css.File exposing - ( Stylesheet, stylesheet, compile, compiler, CssFileStructure, CssCompilerProgram - , UniqueClass, uniqueClass, UniqueSvgClass, uniqueSvgClass - ) - -{-| - - -# DEPRECATED - -Compiling to .css files is deprecated, and support is planned to be removed in a -future release (likely sometime in 2018), once [`Html.Styled`](Html-Styled) has -matured sufficiently. The design goal is for elm-css to offer One Way To Do It, -and that one way is planned to be `Html.Styled`! - - -## Css.File - -Functions for writing CSS files from elm-css. - -@docs Stylesheet, stylesheet, compile, compiler, CssFileStructure, CssCompilerProgram - - -## Automatically-generated unique classes - -@docs UniqueClass, uniqueClass, UniqueSvgClass, uniqueSvgClass - --} - -import Css.Preprocess as Preprocess exposing (Snippet, Style) -import Css.Preprocess.Resolve as Resolve - - -{-| A description of CSS files that will be created by elm-css. --} -type alias CssFileStructure = - List - { filename : String - , content : String - } - - -{-| Compile the given stylesheets to a CSS string, or to an error -message if it could not be compiled. --} -compile : List Stylesheet -> { css : String } -compile stylesheets = - { css = Resolve.compileSheets stylesheets } - - -{-| Create a program that compiles an elm-css stylesheet to a CSS file. - - import Css.File exposing (CssCompilerProgram, CssFileStructure) - import HomepageCss as Homepage - - port files : CssFileStructure -> Cmd msg - - fileStructure : CssFileStructure - fileStructure = - Css.File.toFileStructure - [ ( "homepage.css", Css.File.compile [ Homepage.css ] ) ] - - main : CssCompilerProgram - main = - Css.File.compiler files fileStructure - --} -compiler : (CssFileStructure -> Cmd Never) -> CssFileStructure -> CssCompilerProgram -compiler filesPort structure = - Platform.program - { init = ( (), filesPort structure ) - , update = \_ _ -> ( (), Cmd.none ) - , subscriptions = \_ -> Sub.none - } - - -{-| A prorgam that compiles a CSS file. - -See [`compiler`](#compiler). - --} -type alias CssCompilerProgram = - Program Never () Never - - -{-| -} -type alias Stylesheet = - Preprocess.Stylesheet - - -{-| Styles scoped under an automatically-generated class. --} -type UniqueClass - = UniqueClass (List Style) - - -{-| Styles scoped under an automatically-generated class. Use these for -elements, as they use a different --} -type UniqueSvgClass - = UniqueSvgClass (List Style) - - -{-| Create a style scoped under an automatically-generated class that is -guaranteed to be unique - at least relative to other class names generated -using this function! - -Note: Use [`uniqueSvgClass`](#uniqueSvgClass) for classes that will be used -with SVG elements. These will not work with them! - --} -uniqueClass : List Style -> UniqueClass -uniqueClass = - UniqueClass - - -{-| Create a style scoped under an automatically-generated class that is -guaranteed to be unique - at least relative to other class names generated -using this function! - -Note: Use [`uniqueClass`](#uniqueClass) for classes that will be used with -SVG elements. These will only work with SVGs! - --} -uniqueSvgClass : List Style -> UniqueSvgClass -uniqueSvgClass = - UniqueSvgClass - - -{-| A stylesheet. - - stylesheet - [ body - [ width (px 960) - , color (rgb 7 7 7) - ] - ] - --} -stylesheet : List Snippet -> Stylesheet -stylesheet = - Preprocess.stylesheet diff --git a/src/Html/Styled.elm b/src/Html/Styled.elm index 71ed12b1..9de1d70b 100644 --- a/src/Html/Styled.elm +++ b/src/Html/Styled.elm @@ -17,6 +17,7 @@ module Html.Styled exposing , small, cite, dfn, abbr, time, var, samp, kbd, s, q , mark, ruby, rt, rp, bdi, bdo, wbr , details, summary, menuitem, menu + , keygen ) {-| Drop-in replacement for the `Html` module from the `elm-lang/html` package. diff --git a/src/Html/Styled/Attributes.elm b/src/Html/Styled/Attributes.elm index fb128d1e..a0d7d0f9 100644 --- a/src/Html/Styled/Attributes.elm +++ b/src/Html/Styled/Attributes.elm @@ -18,6 +18,7 @@ module Html.Styled.Attributes exposing , accesskey, contenteditable, contextmenu, dir, draggable, dropzone , itemprop, lang, spellcheck, tabindex , cite, datetime, pubdate, manifest + , downloadAs ) {-| Drop-in replacement for the `Html.Attributes` module from the `elm-lang/html` package. diff --git a/src/Svg/Styled.elm b/src/Svg/Styled.elm index 41d9ff29..4c335961 100644 --- a/src/Svg/Styled.elm +++ b/src/Svg/Styled.elm @@ -92,7 +92,6 @@ The only functions added are `styled`, `toUnstyled`, `toNonceUnstyled` and `from import Css exposing (Style) import Html.Styled as Html -import Json.Encode as Json import Svg.Styled.Internal as Internal import VirtualDom import VirtualDom.Styled diff --git a/src/VirtualDom/Styled.elm b/src/VirtualDom/Styled.elm index 780a7159..531fc9cd 100644 --- a/src/VirtualDom/Styled.elm +++ b/src/VirtualDom/Styled.elm @@ -36,7 +36,6 @@ import Css.Preprocess.Resolve as Resolve import Css.Structure as Structure import Dict exposing (Dict) import Hash -import Hex import Json.Encode import VirtualDom @@ -303,7 +302,7 @@ getCssTemplate styles = [] -> "" - otherwise -> + _ -> [ makeSnippet styles templateSelector ] |> Preprocess.stylesheet |> Resolve.compile diff --git a/tests/Keyframes.elm b/tests/Keyframes.elm index fd9fa8e4..8b155617 100644 --- a/tests/Keyframes.elm +++ b/tests/Keyframes.elm @@ -2,10 +2,10 @@ module Keyframes exposing (assertEmptyKeyframesForProperty, suite, testEmptyKeyf import Css exposing (..) import Css.Animations as Anim exposing (Keyframes, keyframes) -import Css.Global exposing (Snippet, a, body, button, class, i, li, media, mediaQuery, p, ul) +import Css.Global exposing (body, button, i, p) import Css.Preprocess exposing (stylesheet) import Expect -import Test exposing (Test, describe, test, todo) +import Test exposing (Test, describe, test) import TestUtil exposing (outdented, prettyPrint) diff --git a/tests/Tests.elm b/tests/Tests.elm index 42fa1948..16e101da 100644 --- a/tests/Tests.elm +++ b/tests/Tests.elm @@ -1,6 +1,6 @@ module Tests exposing (atRule, attributeCombinator, backgrounds, borders, bug140, bug280, bug335, bug99, divWidthHeight, fonts, greenOnHoverStyle, importantOnBatch, keyValue, leftRightTopBottom, multiDescendent, multiSelector, nestedAtRule, nestedEach, pseudoClasses, pseudoElements, simpleEach, transformsStyle, underlineOnHoverManual, underlineOnHoverStyle, universal, unstyledDiv) -import Expect exposing (Expectation) +import Expect import Fixtures import Test exposing (..) import TestUtil exposing (outdented, prettyPrint)