Okay, so I have a page using bootstrap. When using CSSBox to inline the styles to send as an html email, 'screen' just doesn't cut it because I cannot specify the screen dims so the html renders properly, so it results in treating the page as though it's really thin (i.e. a mobile view).
How can I specify to CSSBox how to respond to media queries, specifically how to handle a device width?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First, media query support must be added to jStyleParser. Then, extending CSSBox should be quite easy. You may watch the process on GitHub but at the moment, there is nothing interesting yet.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, so I have a page using bootstrap. When using CSSBox to inline the styles to send as an html email, 'screen' just doesn't cut it because I cannot specify the screen dims so the html renders properly, so it results in treating the page as though it's really thin (i.e. a mobile view).
How can I specify to CSSBox how to respond to media queries, specifically how to handle a device width?
Media queries is now a work in progress. A first preview is planned for the next release that is planned in about 2 weeks.
Any way to get early access to this? I need media query support like yesterday ;-)
First, media query support must be added to jStyleParser. Then, extending CSSBox should be quite easy. You may watch the process on GitHub but at the moment, there is nothing interesting yet.
Ok, first version is available on GitHub. You need to update both jStyleParser and CSSBox to the latest master version. There is a new
MediaSpec
class for specifying the current media features andDOMAnalyzer.setMediaSpec()
to tell the analyzer about it. TheBoxBrowser
demo is updated to show the basic usage:https://github.com/radkovo/CSSBox/commit/b2e227426d037222057b6836d9279a08dc118116#diff-38d5ef214744d44ec58aa1598b6d7bad
Any comments are welcome.