Comments (3)
Hi, sorry for the late reply.
The underlying tech in zero-md
is web components, so in the example you provided, the styles from outside the shadowRoot
will not pierce within. (It's a feature not bug 🤣 )
I guess in your use case, you are looking to merge custom styles into the default (provided) styles. There are ways to do it - but all not particularly elegant. I will look at improving that in the next release.
In the meantime, you could try:
<style>
#menu ul {
margin: 0;
padding: 0;
}
#menu li {
display: inline;
padding: 0;
margin: 0;
}
</style>
<!-- Add the `no-shadow` attribute -->
<zero-md id="menu" src="index.md" no-shadow></zero-md>
This renders the markdown into light dom instead, so your custom styles will take effect.
from zero-md.
Thank you very much for the reply.
I didn't know it was an intentional feature to not let styles "pierce within". 😅
I guess in your use case, you are looking to merge custom styles into the default (provided) styles. There are ways to do it - but all not particularly elegant. I will look at improving that in the next release.
That sounds great, I think it is important let users override/remove all CSS, but also merge their styles. Perhaps a merge-css-urls
attribute would suffice to "build upon" the global css-urls
instead of replacing them.
I'm specifying the default css-urls
in addition to my custom CSS stylesheet, but I will try the no-shadow
attribute.
Keep up the great work!
from zero-md.
V2 is released (finally) with built-in support that may help with your use-case.
From your first post #34 (comment) - with V2 your code may look something like this:
<zero-md src="index.md">
<template data-merge="append">
<style>
ul {
margin: 0;
padding: 0;
}
li {
display: inline;
padding: 0;
margin: 0;
}
</style>
</template>
</zero-md>
Closing this for now; feel free to re-open if something's wrong! 🎉
from zero-md.
Related Issues (20)
- Support for math equations HOT 4
- Custom language in code blocks HOT 4
- add 2 topics to documentation HOT 2
- add footnotes support HOT 2
- [Question] How to import ZeroMd in vue3 as node module? HOT 2
- HTML code block not working correctly HOT 4
- How to use zeroMd as module? HOT 3
- Cyrillic anchor links doesn't works HOT 2
- nginx example HOT 3
- BUG: `goto` (scroll to selected element) broken when `no-shadow` enabled HOT 2
- Discussion: Anchor.js usability (for on-hover anchor links) HOT 5
- Mathjax zero-md@{1,2} bug HOT 3
- Mathjax no-shadow window.ZeroMdConfig HOT 2
- Render Mathjax on content change HOT 2
- Is there a way to use mathjax while still supporting shadow dom? HOT 2
- Does zero-md support admonition marked plug-in? HOT 7
- Parse/Render text within HTML tags HOT 2
- prism.js seems to not recognize C++? HOT 3
- Mermaid Support Broken Since Version 2.5.1 HOT 3
- Display table of content TOC HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zero-md.