Skip to content

Remove unused code and imports #582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions src/Css.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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 }


{-| <https://developer.mozilla.org/en-US/docs/Web/CSS/length>
-}
type alias LengthOrAuto compatible =
Expand Down Expand Up @@ -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) ++ "%"
Expand Down
7 changes: 1 addition & 6 deletions src/Css/Animations.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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(..))

Expand All @@ -40,10 +39,6 @@ type alias Property =
AnimationProperty


type alias Style =
Preprocess.Style


{-| -}
type alias Keyframes compatible =
{ compatible | keyframes : Compatible, none : Compatible, value : String }
Expand Down
8 changes: 4 additions & 4 deletions src/Css/Internal.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ _ ->
Expand All @@ -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)


Expand Down
142 changes: 0 additions & 142 deletions src/DEPRECATED/Css/File.elm

This file was deleted.

1 change: 1 addition & 0 deletions src/Html/Styled.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/Html/Styled/Attributes.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/Svg/Styled.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/VirtualDom/Styled.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -303,7 +302,7 @@ getCssTemplate styles =
[] ->
""

otherwise ->
_ ->
[ makeSnippet styles templateSelector ]
|> Preprocess.stylesheet
|> Resolve.compile
Expand Down
4 changes: 2 additions & 2 deletions tests/Keyframes.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion tests/Tests.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down