Skip to content

Refactor inlineStyles#1601

Merged
TrySound merged 1 commit intomasterfrom
refactor-inline-styles
Oct 29, 2021
Merged

Refactor inlineStyles#1601
TrySound merged 1 commit intomasterfrom
refactor-inline-styles

Conversation

@TrySound
Copy link
Copy Markdown
Member

@TrySound TrySound commented Oct 3, 2021

This is a big one

  • got rid from another closestByName usage
  • delegated removing empty defs elements to removeEmptyContainers plugin
  • got rid from all css-tools usages (most inlineStyles code was there
    for some reason)
  • combined a few loops
  • fixed useMqs option (I would remove it in v3 for simplicity as it
    seems nobody use it)

cc @strarsis

This is a big one

- got rid from another closestByName usage
- delegated removing empty defs elements to removeEmptyContainers plugin
- got rid from all css-tools usages (most inlineStyles code was there
  for some reason)
- combined a few loops
- fixed useMqs option (I would remove it in v3 for simplicity as it
  seems nobody use it)
const cssTools = require('../lib/css-tools');
/**
* @typedef {import('../lib/types').Specificity} Specificity
* @typedef {import('../lib/types').XastElement} XastElement
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm really starting to see the benefits of jsdocs inside a ts project. You can define your types outside, as plain ts files and use on js files :D

@strarsis
Copy link
Copy Markdown
Contributor

strarsis commented Oct 4, 2021

Ah yes, in the good old times (1, 2 years ago) svgo didn't use any TS features and I tried to isolate the CSS-related stuff into a separate object.
LGTM, lots of code is deduplicated and simplified.

@TrySound TrySound merged commit 72b9722 into master Oct 29, 2021
@TrySound TrySound deleted the refactor-inline-styles branch October 29, 2021 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants