-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Operators for class directive #233
Labels
enhancement
New feature or request
Comments
jr-k
added a commit
to jr-k/marpit
that referenced
this issue
Oct 27, 2023
More control over classnames (as described here: marp-team#233). ```js var class = "invert pink embed"; // => "invert pink embed" var class = "invert -pink embed"; // => "invert embed" var class = "invert -pink embed +pink"; // => "invert embed pink" ```
jr-k
added a commit
to jr-k/marpit
that referenced
this issue
Oct 27, 2023
More control over classnames (as described here: marp-team#233). ```js var class = "invert pink embed"; // => "invert pink embed" var class = "invert -pink embed"; // => "invert embed" var class = "invert -pink embed +pink"; // => "invert embed pink" ```
jr-k
added a commit
to jr-k/marpit
that referenced
this issue
Oct 27, 2023
More control over classnames (as described here: marp-team#233). ```js var class = "invert pink embed"; // => "invert pink embed" var class = "invert -pink embed"; // => "invert embed" var class = "invert -pink embed +pink"; // => "invert embed pink" ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For now,
class
directive is just meaningsetAttribute('class', 'xxxxxx')
so assign the specified value into the slide as is. The problem is removing inherited class unless re-assign the class manually.When setting the whole of color scheme by
class
, it may lose the color if changed the layout in a part of slide via_class
spot directive.The second page has lost
invert
color.Proposal
Marpit recognizes
+
and-
prefix in each of class names, and manipulate inherited class based on the operator. Don't require to know the inherited class.<!-- _class: +lead -->
addslead
class into the inherited class.<!-- _class: -invert -->
removesinvert
class from the inherited class.It works on local directives and spot directives.
By this change, the class name beginning from specific operators cannot use in Marpit. Beginning
+
and-
are valid as HTML class but not common because+
requires to escape character in CSS definition.The text was updated successfully, but these errors were encountered: