Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[archive] config based on current defaults #26

Open
tobwen opened this issue Sep 27, 2020 · 5 comments
Open

[archive] config based on current defaults #26

tobwen opened this issue Sep 27, 2020 · 5 comments
Labels

Comments

@tobwen
Copy link

tobwen commented Sep 27, 2020

I've just created a config based on the current defaults (3e81e7a). This might help others with playing with the settings - at least it helped my.

{
    "collapse-g": [ true ],
    "collapse-textwrap": [ true ],
    "combine-path": [ true, {
            "disregardFill": false,
            "disregardOpacity": false
        }
    ],
    "combine-transform": [ true, {
            "angelDigit": 2,
            "sizeDigit": 2,
            "trifuncDigit": 3
        }
    ],
    "compute-path": [ true, {
            "angelDigit": 2,
            "sizeDigit": 2,
            "straighten": 0,
            "thinning": 0
        }
    ],
    "rm-attribute": [ true, {
            "keepAria": false,
            "keepEvent": false,
            "rmDefault": true
        }
    ],
    "rm-comments": [ true ],
    "rm-doctype": [ true ],
    "rm-hidden": [ true ],
    "rm-irregular-nesting": [ true, {
            "ignore": []
        }
    ],
    "rm-irregular-tag": [ true, {
            "ignore": []
        }
    ],
    "rm-px": [ true ],
    "rm-unnecessary": [ true, {
            "tags": [
                "desc",
                "discard",
                "foreignObject",
                "video",
                "audio",
                "iframe",
                "canvas",
                "metadata",
                "script",
                "title",
                "unknown",
                "image"
            ]
        }
    ],
    "rm-version": [ true ],
    "rm-viewbox": [ true ],
    "rm-xml-decl": [ true ],
    "rm-xmlns": [ true ],
    "shorten-animate": [ true, {
            "remove": false
        }
    ],
    "shorten-class": [ true ],
    "shorten-color": [ true, {
            "opacityDigit": 3,
            "rrggbbaa": false
        }
    ],
    "shorten-decimal-digits": [ true, {
            "angelDigit": 2,
            "sizeDigit": 2
        }
    ],
    "shorten-defs": [ true ],
    "shorten-filter": [ true ],
    "shorten-id": [ true ],
    "shorten-shape": [ true, {
            "thinning": 0
        }
    ],
    "shorten-style-attr": [ true, {
            "exchange": false,
            "rmDefault": true
        }
    ],
    "shorten-style-tag": [ true, {
            "deepShorten": true,
            "rmDefault": true
        }
    ]
}
@benboba
Copy link
Owner

benboba commented Sep 28, 2020

Hello, I am working on the development of version 2.0.0. There will be some changes to the config of this version. You can see these changes in the develop branch.

2.0.0 will split config into rules and params, some common settings will be merged into params, and browserlist will be introduced to adapt to different environments (for the time being, only geometry properties are involved).

@tobwen
Copy link
Author

tobwen commented Sep 28, 2020

Could you provide a new "default ruleset" for this (or maybe I can build one again)? It allows easy access to the processing of the numerous parameters. I love your readme, but sometimes tweaking the rules is easier, when the defaults are known.

@tobwen
Copy link
Author

tobwen commented Sep 28, 2020

hint

You have forgotten "deepShorten": boolean as a configuration of shorten-style-tag in the documentation.

That seems to be the current default set.

{
    "rules": {
        "collapse-g": true,
        "collapse-textwrap": true,
        "combine-path": [ false, {
                "disregardFill": false,
                "disregardOpacity": false
            }
        ],
        "combine-transform": true,
        "compute-path": true,
        "rm-attribute": [ true, {
                "keepAria": false,
                "keepEvent": false
            }
        ],
        "rm-comments": true,
        "rm-doctype": true,
        "rm-hidden": true,
        "rm-irregular-nesting": [ true, {
                "ignore": []
            }
        ],
        "rm-irregular-tag": [ true, {
                "ignore": []
            }
        ],
        "rm-px": true,
        "rm-unnecessary": [ true, {
                "tags": [
                    "desc",
                    "discard",
                    "foreignObject",
                    "video",
                    "audio",
                    "iframe",
                    "canvas",
                    "metadata",
                    "script",
                    "title",
                    "unknown",
                    "image"
                ]
            }
        ],
        "rm-version": true,
        "rm-viewbox": true,
        "rm-xml-decl": true,
        "rm-xmlns": true,
        "shorten-animate": [ true, {
                "remove": false
            }
        ],
        "shorten-class": true,
        "shorten-color": [ true, {
                "rrggbbaa": false
            }
        ],
        "shorten-decimal-digits": true,
        "shorten-defs": true,
        "shorten-filter": true,
        "shorten-id": true,
        "shorten-shape": true,
        "shorten-style-attr": true,
        "shorten-style-tag": [ true, {
                "deepShorten": true
            }
        ],
    },
    "params": {
        "sizeDigit": 2,
        "angelDigit": 2,
        "trifuncDigit": 3,
        "opacityDigit": 3,
        "thinning": 0,
        "straighten": 0,
        "mergePoint": 0,
        "rmAttrEqDefault": true,
        "exchangeStyle": false
    },
    "browsers": ["defaults"]
}

@benboba
Copy link
Owner

benboba commented Oct 9, 2020

Thanks for correcting me, I have updated the document

@benboba
Copy link
Owner

benboba commented Nov 2, 2020

Now that 2.0.1 has been released, the default configuration of the new optimization rules is as follows:

{
    "rules": {
        "apply-style": true,
        "collapse-g": true,
        "collapse-textwrap": true,
        "combine-path": [ false, {
                "disregardFill": false,
                "disregardOpacity": false
            }
        ],
        "combine-transform": true,
        "compute-path": true,
        "rm-attribute": [ true, {
                "keepAria": false,
                "keepEvent": false
            }
        ],
        "rm-comments": true,
        "rm-doctype": true,
        "rm-hidden": true,
        "rm-important": true,
        "rm-illegal-style": true,
        "rm-irregular-nesting": [ true, {
                "ignore": []
            }
        ],
        "rm-irregular-tag": [ true, {
                "ignore": []
            }
        ],
        "rm-px": true,
        "rm-unnecessary": [ true, {
                "tags": [
                    "desc",
                    "discard",
                    "foreignObject",
                    "video",
                    "audio",
                    "iframe",
                    "canvas",
                    "metadata",
                    "script",
                    "title",
                    "unknown",
                    "image"
                ]
            }
        ],
        "rm-version": true,
        "rm-viewbox": true,
        "rm-xml-decl": true,
        "rm-xmlns": true,
        "shorten-animate": [ true, {
                "remove": false
            }
        ],
        "shorten-class": true,
        "shorten-color": [ true, {
                "rrggbbaa": false
            }
        ],
        "shorten-decimal-digits": true,
        "shorten-defs": true,
        "shorten-filter": true,
        "shorten-id": true,
        "shorten-shape": true,
        "shorten-style-attr": true,
        "shorten-style-tag": true,
        "style-to-class": true
    },
    "params": {
        "sizeDigit": 2,
        "angelDigit": 2,
        "trifuncDigit": 3,
        "opacityDigit": 3,
        "thinning": 0,
        "straighten": 0,
        "mergePoint": 0,
        "rmAttrEqDefault": true,
        "exchangeStyle": false,
        "ignoreKnownCSS": false
    },
    "browsers": ["defaults"]
}

@benboba benboba added the archive label Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants