Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mincss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
mincss
Commits
7c912845
Commit
7c912845
authored
10 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Changed a function name
parent
68e19c17
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shorthand.ml
+7
-7
7 additions, 7 deletions
shorthand.ml
with
7 additions
and
7 deletions
shorthand.ml
+
7
−
7
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
->
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment