Test: Resolve `calc(100% / 6)`

Open Beginner friendly
#270 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
90/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
css
Domain
testing

Research direction

Start in the calc/00xx test area and inspect nearby cases to follow the repository's fixture format. Add the calc(100% / 6) case with the shown precision variants and expected minified output, then run the relevant test command for the calc fixtures to verify the result.

Written by the indexing model from the issue text.

Description

calc/00xx

# Resolve `calc(100% / 6)`

Replace the calculation with the result to reduce character count. For accuracy
you must retain at least 4 decimal points of precision, but no more than 7 as
that would be the same length as retaining the calculation. The last digit must
be a rounded `7`.
.a {
  width: calc(100% / 6);
}
.a{width:16.6667%}
.a{width:16.66667%}
.a{width:16.666667%}
.a{width:16.6666667%}

CSS Minifier Playground

Minifier Version 🏆 Size Output
lightning v1.33.0 🏆 18 .a{width:16.6667%}
csslop v0.0.39 22 .a{width:calc(100%/6)}
csskit v0.0.32 22 .a{width:calc(100%/6)}
csso v5.0.5 22 .a{width:calc(100%/6)}
cleancss v5.3.3 24 .a{width:calc(100% / 6)}
esbuild v0.28.2 24 .a{width:calc(100% / 6)}
sass v1.104.1 24 .a{width:16.6666666667%}
cssnano v9.0.5 25 .a{width:calc(16.66667%)}
Dominant language
JavaScript
Stars
13
Forks
3
Avg merge
5h 4m
Merged PRs (30d)
53

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from keithamus/css-minify-tests

All issues in keithamus/css-minify-tests

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.