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

Suppress confusable theme import when tweaking #33

Merged
merged 3 commits into from
Jun 1, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented May 31, 2018

This PR suppresses the confusable theme import when tweaking by <style> element and style global directive.

v0.0.6 could import another theme in tweaking style. However, the imported rule by @import would give confusion about the order of CSS rules because it is rolled-up to the beginning of packed style.

/* @theme test */
h1 { font-size: 1em; }
/* @theme test2 */
h1 { font-size: 2em; }
---
theme: test
---

<style>
@import 'test2';
</style>

# Hello

The user would expect to see "Hello" by font-size: 2em. But actually, styles would apply 1em. This is because styles are ordered by "Imported theme in inline style ➡️ Slide theme ➡️ Inline style" under the influence of a roll-up plugin.

To prevent a confusable behavior, we have decided to suppress importing another theme in inline styles at this moment. @import and @import-theme feature are overlapped in effect with theme directive.

Of course you can still use @import without importing another theme.

@yhatt yhatt merged commit fc581a6 into master Jun 1, 2018
@yhatt yhatt deleted the suppress-confusable-import branch June 1, 2018 01:25
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.

1 participant