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

[Regression] Inline styles do not append in the end of CSS #288

Closed
yhatt opened this issue Apr 26, 2021 · 0 comments · Fixed by #289
Closed

[Regression] Inline styles do not append in the end of CSS #288

yhatt opened this issue Apr 26, 2021 · 0 comments · Fixed by #289
Labels
bug Something isn't working

Comments

@yhatt
Copy link
Member

yhatt commented Apr 26, 2021

By dramatically change of PostCSS v8 architecture, inline style appendation into the end of CSS would not work correctly since Marpit v2.

Reported in marp-team/marp#96.

PoC

const { Marpit } = require('@marp-team/marpit')
new Marpit().render('<style>section { color: red; }</style>').css
v1.6.4 v2.0.0
@page {
  size: 1280px 720px;
  margin: 0;
}@media print {html, body {
  background-color: #fff;
  margin: 0;
  page-break-inside: avoid;
  break-inside: avoid-page;
}
  div.marpit > section {
    page-break-before: always;
    break-before: page;
  }

  div.marpit > section, div.marpit > section * {
    -webkit-print-color-adjust: exact !important;
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    color-adjust: exact !important;
    transition: none !important;
  }

  div.marpit > svg[data-marpit-svg] {
    display: block;
    height: 100vh;
    width: 100vw;
  }
}

div.marpit > section {
  width: 1280px;
  height: 720px;

  box-sizing: border-box;
  overflow: hidden;
  position: relative;

  scroll-snap-align: center center;
}

div.marpit > section::after {
  bottom: 0;
  content: attr(data-marpit-pagination);
  padding: inherit;
  pointer-events: none;
  position: absolute;
  right: 0;
}

div.marpit > section:not([data-marpit-pagination])::after {
  display: none;
}

/* Normalization */
div.marpit > section h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

div.marpit > section video::-webkit-media-controls {
  will-change: transform;
}

div.marpit > section { color: red; }
@page {
  size: 1280px 720px;
  margin: 0;
}@media print {html, body {
  background-color: #fff;
  margin: 0;
  page-break-inside: avoid;
  break-inside: avoid-page;
}
  div.marpit > section {
    page-break-before: always;
    break-before: page;
  }

  div.marpit > section, div.marpit > section * {
    -webkit-print-color-adjust: exact !important;
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    color-adjust: exact !important;
    transition: none !important;
  }

  div.marpit > svg[data-marpit-svg] {
    display: block;
    height: 100vh;
    width: 100vw;
  }
}div.marpit > section {
  width: 1280px;
  height: 720px;

  box-sizing: border-box;
  overflow: hidden;
  position: relative;

  scroll-snap-align: center center;
}div.marpit > section { color: red; }

div.marpit > section::after {
  bottom: 0;
  content: attr(data-marpit-pagination);
  padding: inherit;
  pointer-events: none;
  position: absolute;
  right: 0;
}

div.marpit > section:not([data-marpit-pagination])::after {
  display: none;
}

/* Normalization */
div.marpit > section h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

div.marpit > section video::-webkit-media-controls {
  will-change: transform;
}

In v2.0.0, the inline style section { color: red; } has been inserted in the middle of scaffold theme.

Updated test 36ef885 is failing in v2.0.0 but pass in v1.6.4.

@yhatt yhatt added the bug Something isn't working label Apr 26, 2021
@yhatt yhatt changed the title [Regression] Inline styles does not append in the last of CSS [Regression] Inline styles does not append in the end of CSS Apr 26, 2021
@yhatt yhatt changed the title [Regression] Inline styles does not append in the end of CSS [Regression] Inline styles do not append in the end of CSS Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant