Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mincss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
mincss
Commits
7c912845
Commit
7c912845
authored
Jul 24, 2014
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed a function name
parent
68e19c17
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
shorthand.ml
shorthand.ml
+7
-7
No files found.
shorthand.ml
View file @
7c912845
...
...
@@ -23,20 +23,20 @@ let rec decls_mem name = function
|
(
nm
,
_
,
false
)
::
_
when
nm
=
name
->
true
|
_
::
tl
->
decls_mem
name
tl
let
rec
prop_value
name
=
function
let
rec
decls_find
name
=
function
|
[]
->
raise
Not_found
|
(
nm
,
value
,
false
)
::
_
when
nm
=
name
->
value
|
_
::
tl
->
prop_value
name
tl
|
_
::
tl
->
decls_find
name
tl
let
order
base
decls
=
let
rec
filter
=
function
|
[]
->
[]
|
"size"
::
tl
when
base
=
"font"
&&
decls_mem
"line-height"
decls
->
let
font_size
=
prop_value
"font-size"
decls
in
let
line_height
=
prop_value
"line-height"
decls
in
let
font_size
=
decls_find
"font-size"
decls
in
let
line_height
=
decls_find
"line-height"
decls
in
Nary
(
"/"
,
[
font_size
;
line_height
])
::
filter
tl
|
name
::
tl
when
decls_mem
(
base
^
"-"
^
name
)
decls
->
prop_value
(
base
^
"-"
^
name
)
decls
::
filter
tl
decls_find
(
base
^
"-"
^
name
)
decls
::
filter
tl
|
_
::
tl
->
filter
tl
in
filter
(
subprops
base
)
...
...
@@ -53,12 +53,12 @@ let rec shorten decls = function
|
(
"margin"
|
"padding"
)
as
base
when
let
has
dir
=
decls_mem
(
base
^
"-"
^
dir
)
decls
in
has
"top"
&&
has
"right"
&&
has
"bottom"
&&
has
"left"
->
let
get
dir
=
prop_value
(
base
^
"-"
^
dir
)
decls
in
let
get
dir
=
decls_find
(
base
^
"-"
^
dir
)
decls
in
Some
(
Concat
[
get
"top"
;
get
"right"
;
get
"bottom"
;
get
"left"
])
|
_
->
None
let
make_shorthands
decls
=
(* find
base
names for which properties are present *)
(* find
shorthand
names for which properties are present *)
let
rec
find_props
=
function
|
[]
->
SS
.
empty
|
(
name
,
value
,
false
)
::
tl
when
Str
.
string_match
pattern
name
0
->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment