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
591c9af7
Commit
591c9af7
authored
Oct 02, 2014
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
369ee206
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
30 deletions
+28
-30
duplicates.ml
duplicates.ml
+6
-6
shorthand.ml
shorthand.ml
+13
-13
simple.ml
simple.ml
+7
-7
util.ml
util.ml
+2
-4
No files found.
duplicates.ml
View file @
591c9af7
...
...
@@ -29,9 +29,9 @@ let prune_duplicates decls =
in
prune
0
decls
let
transform
=
function
|
Statement
(
Ruleset
(
selectors
,
decls
))
->
Statement
(
Ruleset
(
selectors
,
prune_duplicates
decls
))
|
v
->
v
let
compress
=
Util
.
transform_stylesheet
transform
let
compress
=
Util
.
transform_stylesheet
begin
function
|
Statement
(
Ruleset
(
selectors
,
decls
))
->
Statement
(
Ruleset
(
selectors
,
prune_duplicates
decls
))
|
v
->
v
end
shorthand.ml
View file @
591c9af7
...
...
@@ -274,16 +274,16 @@ let make_shorthands decls =
in
List
.
filter
keep_prop
decls
@
shorthands
let
transform
=
function
|
Statement
(
Ruleset
(
selectors
,
decls
))
->
Statement
(
Ruleset
(
selectors
,
make_shorthands
decls
))
|
v
->
v
let
compress
=
Util
.
transform_stylesheet
transform
let
transform_unfold
=
function
|
Statement
(
Ruleset
(
selectors
,
decls
))
->
Statement
(
Ruleset
(
selectors
,
unfold
decls
))
|
v
->
v
let
unfold_stylesheet
=
Util
.
transform_stylesheet
transform_unfol
d
let
compress
=
Util
.
transform_stylesheet
begin
function
|
Statement
(
Ruleset
(
selectors
,
decls
))
->
Statement
(
Ruleset
(
selectors
,
make_shorthands
decls
))
|
v
->
v
end
let
unfold_stylesheet
=
Util
.
transform_stylesheet
begin
function
|
Statement
(
Ruleset
(
selectors
,
decls
))
->
Statement
(
Ruleset
(
selectors
,
unfold
decls
))
|
v
->
v
en
d
simple.ml
View file @
591c9af7
...
...
@@ -47,10 +47,10 @@ let shorten_font_weight = function
|
Ident
"bold"
->
Number
(
700
.
0
,
None
)
|
v
->
v
let
transform
=
function
|
Expr
value
->
Expr
(
shorten_expr
value
)
|
Declaration
(
"font-weight"
,
value
,
imp
)
->
Declaration
(
"font-weight"
,
shorten_font_weight
value
,
imp
)
|
v
->
v
let
compress
=
Util
.
transform_stylesheet
transform
let
compress
=
Util
.
transform_stylesheet
begin
function
|
Expr
value
->
Expr
(
shorten_expr
value
)
|
Declaration
(
"font-weight"
,
value
,
imp
)
->
Declaration
(
"font-weight"
,
shorten_font_weight
value
,
imp
)
|
v
->
v
end
util.ml
View file @
591c9af7
...
...
@@ -237,7 +237,7 @@ let is_color = Color_names.is_color
(* Sorting declarations *)
let
sort_stylesheet
=
let
transform_sort_decls
=
function
transform_stylesheet
begin
function
|
Statement
(
Ruleset
(
selectors
,
decls
))
->
let
pattern
=
Str
.
regexp
"^
\\
([^-]+
\\
)-"
in
let
stem
x
=
...
...
@@ -246,6 +246,4 @@ let sort_stylesheet =
let
cmp
(
a
,
_
,
_
)
(
b
,
_
,
_
)
=
String
.
compare
(
stem
a
)
(
stem
b
)
in
Statement
(
Ruleset
(
selectors
,
List
.
stable_sort
cmp
decls
))
|
v
->
v
in
transform_stylesheet
transform_sort_decls
end
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