mayneyao / gatsby-source-notion-database

Load data from Notion's database [WIP]
MIT License
92 stars 20 forks source link

HTML Output Display Behaviour #1

Closed conradlin closed 4 years ago

conradlin commented 4 years ago

I found an issue with your HTML output, it contains max-width: calc((100vw - 0px) - 192px); , which will make it display badly on mobile. You can see this in your demo site. Do you have any ideas how I can parse out the specific style in the plugin?

Thanks!

https://files.slack.com/files-pri/TEPE1V8MU-FSM0N4V0R/image.png

mayneyao commented 4 years ago

You can add some code to fix this when fetch html using puppeteer. after this line https://github.com/mayneyao/gatsby-source-notion-database/blob/master/src/getPageHtml.js#L85

document.querySelectorAll(`div[data-block-id]`).forEach(block=>{
    block.style.maxWidth=""
})

or override css, just like this https://github.com/mayneyao/gine-blog/blob/master/src/index.css#L98-L100

div[data-block-id] {
 max-width: '100%!important'
}
conradlin commented 4 years ago

Thank you so much! I took the second route. 👍