Skip to content

Commit 2f9fc7e

Browse files
authored
appearance property; resolves #16. (#18)
1 parent 007411e commit 2f9fc7e

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Breaking changes:
88

99
New features:
1010
- `:focus-within` pseudo-class nsaunders/purescript-tecton#17
11+
- `appearance` property nsaunders/purescript-tecton#18
1112

1213
Bugfixes:
1314

src/Tecton.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import Tecton.Internal
3333
, animationName
3434
, animationPlayState
3535
, animationTimingFunction
36+
, appearance
3637
, arabicIndic
3738
, armenian
3839
, article
@@ -367,6 +368,7 @@ import Tecton.Internal
367368
, media'
368369
, medium
369370
, menu
371+
, menulistButton
370372
, method
371373
, middle
372374
, min
@@ -633,6 +635,7 @@ import Tecton.Internal
633635
, textTop
634636
, textTransform
635637
, textarea
638+
, textfield
636639
, tfoot
637640
, th
638641
, thai

src/Tecton/Internal.purs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Tecton.Internal
77
, class AnimationDirectionKeyword
88
, class AnimationFillModeKeyword
99
, class AnimationPlayStateKeyword
10+
, class AppearanceKeyword
1011
, class Assoc
1112
, class AttachmentKeyword
1213
, class Attribute
@@ -235,6 +236,7 @@ module Tecton.Internal
235236
, animationName
236237
, animationPlayState
237238
, animationTimingFunction
239+
, appearance
238240
, arabicIndic
239241
, armenian
240242
, article
@@ -590,6 +592,7 @@ module Tecton.Internal
590592
, media'
591593
, medium
592594
, menu
595+
, menulistButton
593596
, method
594597
, middle
595598
, min
@@ -865,6 +868,7 @@ module Tecton.Internal
865868
, textTop
866869
, textTransform
867870
, textarea
871+
, textfield
868872
, tfoot
869873
, th
870874
, thai
@@ -7069,6 +7073,29 @@ instance declarationOutlineOffset ::
70697073
Declaration "outline-offset" (Measure t) where
70707074
pval = const val
70717075

7076+
-- https://www.w3.org/TR/css-ui-4/#propdef-appearance
7077+
7078+
appearance = Proxy :: Proxy "appearance"
7079+
7080+
instance Property "appearance"
7081+
7082+
textfield = Proxy :: Proxy "textfield"
7083+
menulistButton = Proxy :: Proxy "menulist-button"
7084+
7085+
class AppearanceKeyword (s :: Symbol)
7086+
7087+
instance AppearanceKeyword "none"
7088+
instance AppearanceKeyword "auto"
7089+
instance AppearanceKeyword "textfield"
7090+
instance AppearanceKeyword "menulist-button"
7091+
7092+
instance declarationAppearance ::
7093+
( AppearanceKeyword s
7094+
, IsSymbol s
7095+
) =>
7096+
Declaration "appearance" (Proxy s) where
7097+
pval = const val
7098+
70727099
--------------------------------------------------------------------------------
70737100

70747101
-- https://www.w3.org/TR/CSS2/visufx.html

test/UISpec.purs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Test.UISpec where
55
import Prelude
66

77
import Color (rgb)
8-
import Tecton (auto, dashed, dotted, double, groove, inherit, initial, inset, invert, medium, nil, none, outlineColor, outlineOffset, outlineStyle, outlineWidth, outset, px, ridge, solid, thick, thin, transparent, unset, (:=))
8+
import Tecton (appearance, auto, dashed, dotted, double, groove, inherit, initial, inset, invert, medium, menulistButton, nil, none, outlineColor, outlineOffset, outlineStyle, outlineWidth, outset, px, ridge, solid, textfield, thick, thin, transparent, unset, (:=))
99
import Test.Spec (Spec, describe)
1010
import Test.Util (isRenderedFromInline)
1111

@@ -85,3 +85,21 @@ spec = do
8585
"outline-offset:4px" `isRenderedFrom` (outlineOffset := px 4)
8686

8787
"outline-offset:0" `isRenderedFrom` (outlineOffset := nil)
88+
89+
describe "appearance property" do
90+
91+
"appearance:inherit" `isRenderedFrom` (appearance := inherit)
92+
93+
"appearance:initial" `isRenderedFrom` (appearance := initial)
94+
95+
"appearance:unset" `isRenderedFrom` (appearance := unset)
96+
97+
"appearance:none" `isRenderedFrom` (appearance := none)
98+
99+
"appearance:auto" `isRenderedFrom` (appearance := auto)
100+
101+
"appearance:textfield" `isRenderedFrom` (appearance := textfield)
102+
103+
"appearance:menulist-button"
104+
`isRenderedFrom`
105+
(appearance := menulistButton)

0 commit comments

Comments
 (0)