feat: demo custom srcset feats in readme #29
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the readme for the custom srcsets feature set.
These changes not only reflect the additional features added, but
also try to pin down the semantics of our syntax and
documentation**.
Namely, the differentiation between
fixed
andfluid-width
srcsets.We currently construct two types of srcset attributes: those with
fixed
widths and those with
fluid
widths.Fluid-widths vary. A srcset attribute composed of target width pairs is
described as fluid because each image candidate string denotes a
unique width-described resource.
Fixed-widths are fixed. A srcset attribute composed of pixel density
descriptors (ie.
1x, 2x, 3x
) is described as fixed-width because widthis held constant, while the pixel density descriptors vary.
Prior to this PR, only default fluid-width srcset attributes could be created.
Now, they can be created by supplying a list of
widths
toBuildSrcSet
.Fluid-width sets can also be created by specifying a widths range
that
begin
s andend
s on specified value;. thetol
erance can also bespecified resulting in more customizable fluid-width srcsets.
Prior to this PR, there was no way to customize the quality of fixed-width
sets. Now, variable quality is enabled by default and can be toggled off
by specifying either:
disableVariableQuality=True
, or"q"
parameter (i.e.q=75
)If
"q"
is supplied, it takes precedence over the default qualities anddisable_variable_quality
and it is applied to each image candidatestring (URL) in the srcset attribute.
Lastly, ensure our examples stay current and correct they are
tested in the readme with the remaining tests defined in the
TestReadMe.java
.