Skip to content

Commit 9cd4ffb

Browse files
authored
Rename Identifier type to ElementId. (#37)
1 parent 60f2f1a commit 9cd4ffb

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Breaking changes:
99
- The `keyframesName` function has been dropped. Just use the `KeyframesName` constructor instead. (nsaunders/purescript-tecton#34)
1010
- The `CustomAttribute` type and `att` constructor function have been removed in favor of the [`AttrName` type from `web-html`](https://pursuit.purescript.org/packages/purescript-web-html/4.1.0/docs/Web.HTML.Common#t:AttrName). nsaunders/purescript-tecton#35
1111
- The `&.` operator (`byClass` function) no longer accepts a string argument. Instead, it requires a [`ClassName`](https://pursuit.purescript.org/packages/purescript-web-html/4.1.0/docs/Web.HTML.Common#t:ClassName). nsaunders/purescript-tecton#35
12-
- The `&#` operator (`byId` function) no longer accepts a string argument. Instead, it requires a value of the newly-added `Identifier` type. nsaunders/purescript-tecton#35
12+
- The `&#` operator (`byId` function) no longer accepts a string argument. Instead, it requires a value of the newly-added `ElementId` type. nsaunders/purescript-tecton#35, nsaunders/purescript-tecton#37
1313
- The `nth` function has been dropped, replaced by the `#+` and `#-` operators that can be used to construct **a**_n_+**b** formulas. nsaunders/purescript-tecton#36
1414

1515
New features:

docs/how-to/selectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ import Tecton.Rule as Rule
7373

7474
styleSheet :: CSS
7575
styleSheet = do
76-
universal &# Identifier "appBar" ? Rule.do
76+
universal &# ElementId "appBar" ? Rule.do
7777
height := px 64
7878
```
7979

80-
[![Open with Try PureScript](https://shields.io/badge/-Open%20in%20Try%20PureScript-303748?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAEKADAAQAAAABAAAAEAAAAAA0VXHyAAAArElEQVQ4EeWRzQ6CMBCECSJnwOfiwN2YmCgn49F49cnrzNLdDFhfQDdpd+fbH2hbVf9lKaUaizZ/PTmSByv53I5AO8FjcQgKWqyXFGrYs0nAFEMAn0wEKARIN45ZSzMNfza1bHu4u2gNOzYIuFDMDnKyc73xN2gOdzv51w2YWKbHbzpTn7sfwQAmH0mIuHe98bzYNho1QGKUYr41n6xkg/atYlRfc0e9Svy+eAM93kRyOW/z2AAAAABJRU5ErkJggg==&style=flat)](https://try.purescript.org/?code=LYewJgrgNgpgBAUQB4ENgAdYDoDKAXAT1hwAsYY84B3MgJxgCgGBLDEWygBXqgjHgAUAVQB2zPABo4AgCQBKKQIA8APjlyWbDogBmOmAGNKAhHsN4NrdO0oAVWgU4R6OA7Wbpj9Ef1py4KADOcPaOzjCu7p6a1tqigSj6WADCIDC0BoIQIgn6qemZGjE2IeYgIsXatmUiWABK0PBBcA2wTIGExGQUcABcvXDJODgMHUQR3ZQAvHBgIAxwcNnMAG7pCVBwAGQAxHAAkvwieMw6zOlwAEQo6OgAQii0l3AA-C2NWHMLi3BkzADmJEovRm6CQcAAbAAWJjAFDMER9AamfRGOCicQMOEIuBTb6hJwuNwePBYby+b6LGRLHKJGD5DKMH5walXJToegqJQGcAwFTPVRwcnpUjkSgciiEOBjLpiuCCy5KAD0PP4XKVEv5QA)
80+
[![Open with Try PureScript](https://shields.io/badge/-Open%20in%20Try%20PureScript-303748?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAEKADAAQAAAABAAAAEAAAAAA0VXHyAAAArElEQVQ4EeWRzQ6CMBCECSJnwOfiwN2YmCgn49F49cnrzNLdDFhfQDdpd+fbH2hbVf9lKaUaizZ/PTmSByv53I5AO8FjcQgKWqyXFGrYs0nAFEMAn0wEKARIN45ZSzMNfza1bHu4u2gNOzYIuFDMDnKyc73xN2gOdzv51w2YWKbHbzpTn7sfwQAmH0mIuHe98bzYNho1QGKUYr41n6xkg/atYlRfc0e9Svy+eAM93kRyOW/z2AAAAABJRU5ErkJggg==&style=flat)](https://try.purescript.org/?code=LYewJgrgNgpgBAUQB4ENgAdYDoDKAXAT1hwAsYY84B3MgJxgCgGBLDEWygBXqgjHgAUAVQB2zPABo4AgCQBKKQIA8APjlyWbDogBmOmAGNKAhHsN4NrdO0oAVWgU4R6OA7Wbpj9Ef1py4KADOcPaOzjCu7p6a1tqigSj6WADCIDC0BoIQIgn6qemZGjE2IeYgIsXatmUiWABK0PBBcA2wTIGExGQUcABcvXDJODgMHUQR3ZQAvHBgIAxwcNnMAG7pCVBwAGQAxIiwwDAieACSYHAARCjo6ABCKLQXcAD8LY1YcwuLcGTMAOYkSi9GboJBwABsABYmMAUMwRH0BqZ9EY4KJxAxYfC4FMvqEnC43B48FhvL4vosZEscokYPkMoxvnAqZclOh6ColAZwDAVE9VHAyelSORKOyKIQ4GMuqK4AKLkoAPTc-icxXivlAA)
8181

8282
## Attribute selectors
8383

src/Tecton.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Tecton.Internal
44
( AnPlusB(..)
55
, CSS
66
, Declarations
7-
, Identifier(..)
7+
, ElementId(..)
88
, KeyframesName(..)
99
, a
1010
, abbr

src/Tecton/Internal.purs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module Tecton.Internal
2-
( ($=)
2+
( (#+)
3+
, (#-)
4+
, ($=)
35
, (&#)
46
, (&.)
57
, (&:)
@@ -23,9 +25,8 @@ module Tecton.Internal
2325
, (|~)
2426
, (~)
2527
, (~=)
26-
, (#-)
27-
, (#+)
2828
, Add
29+
, AnPlusB(..)
2930
, Angle
3031
, AttributePredicate
3132
, Auto
@@ -37,6 +38,7 @@ module Tecton.Internal
3738
, Declarations
3839
, Divide
3940
, EasingFunction
41+
, ElementId(..)
4042
, Extensible
4143
, FitContent
4244
, Fixed
@@ -45,7 +47,6 @@ module Tecton.Internal
4547
, FontFaceDeclaration'
4648
, FontFaceFormatFunction
4749
, Gradient
48-
, Identifier(..)
4950
, Inextensible
5051
, KeyframeBlock
5152
, Keyframes
@@ -61,7 +62,6 @@ module Tecton.Internal
6162
, Names
6263
, Nil
6364
, NoAuto
64-
, AnPlusB(..)
6565
, Orientation
6666
, Pair(..)
6767
, Percentage
@@ -176,8 +176,8 @@ module Tecton.Internal
176176
, boxShadow
177177
, boxSizing
178178
, breakAll
179-
, breakWord
180179
, breakSpaces
180+
, breakWord
181181
, button
182182
, byAtt
183183
, byClass
@@ -6000,16 +6000,16 @@ infixl 7 byClass as &.
60006000

60016001
-- https://www.w3.org/TR/selectors-3/#id-selectors
60026002

6003-
newtype Identifier = Identifier String
6003+
newtype ElementId = ElementId String
60046004

6005-
derive newtype instance ToVal Identifier
6005+
derive newtype instance ToVal ElementId
60066006

60076007
byId
60086008
:: forall selector
60096009
. IsExtensibleSelector selector
60106010
=> ToVal selector
60116011
=> selector
6012-
-> Identifier
6012+
-> ElementId
60136013
-> Selector Extensible
60146014
byId s i' = Selector $ val s <> val "#" <> val i'
60156015

test/SelectorsSpec.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Tuple.Nested ((/\))
1010
import Tecton
1111
( AttrName(..)
1212
, ClassName(..)
13-
, Identifier(..)
13+
, ElementId(..)
1414
, a
1515
, active
1616
, after
@@ -135,10 +135,10 @@ spec = do
135135

136136
"*#chapter1{width:0}"
137137
`isRenderedFrom` do
138-
universal &# Identifier "chapter1" ? width := nil
138+
universal &# ElementId "chapter1" ? width := nil
139139

140140
"*#z98y{width:0}" `isRenderedFrom` do
141-
universal &# Identifier "z98y" ? width := nil
141+
universal &# ElementId "z98y" ? width := nil
142142

143143
describe "Pseudo-classes" do
144144

0 commit comments

Comments
 (0)