GithubHelp home page GithubHelp logo

w8tcha / bootstrapemail.net Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 3.83 MB

.NET Version of Bootstrap stylesheet, compiler, and inliner for responsive and consistent emails with the Bootstrap syntax you know and love

License: MIT License

C# 16.04% HTML 49.00% SCSS 4.29% Batchfile 0.04% CSS 30.63%
bootstrap css email-quirks html-email responsive

bootstrapemail.net's Introduction

Hi there ๐Ÿ‘‹

w8tcha's GitHub stats

Top Langs

Readme Card

bootstrapemail.net's People

Contributors

dependabot[bot] avatar w8tcha avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

bootstrapemail.net's Issues

Unable to load DLL 'libsass64' or one of its dependencies

Hi! I'm trying to use this project for processing email templates at runtime. I'm getting this error whenever I create an instance of BootstrapEmail - "Unable to load DLL 'libsass64' or one of its dependencies: The specified module could not be found."
StackTrace:
System.TypeInitializationException
The type initializer for 'LibSass.Compiler.SassCompiler' threw an exception.
at LibSass.Compiler.SassCompiler..ctor(ISassOptions sassOptions)
at BootstrapEmail.Net.Compiler..ctor(String input, ConfigStore config, InputType type)
at BootstrapEmail.Net.BootstrapEmail.StringCompile(String input)
at BootstrapEmail.Net.BootstrapEmail.Compile(String input, String output, InputType type)
Is there a way to resolve this? Thanks!

How to add sass files

Hi! Can you please direct me or give me an example how to use sass files to add new css classes?
I want to add a new background color task using the sass background-color-util. I believe I can add another sass directory and the files will be included and compiled. How can I do that?
Thanks!

[1.4.3] Inline styles are not being generated

Hi!
In the new 1.4.3 version the inline styles are not being generated at all. Here's a comparison with the web version (I haven't included html previously generated with the 1.4.2 version, but it did have inline styles).
result-test.zip
One more catch - original style elements in the head are not being removed in the lib, but are removed in the web.
Thanks!

ArgumentOutOfRangeException in docker

Hi!
I've been trying to use the library in docker, I get this error when running the container:

Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'start')
   at BootstrapEmail.Net.Compiler.GetEmbeddedCoreFiles()
   at BootstrapEmail.Net.Compiler..ctor(String input, ConfigStore config, InputType type)
   at BootstrapEmail.Net.BootstrapEmail.FileCompile(String relativeFilePath, String savePath)
   at BootstrapEmail.Net.BootstrapEmail.Compile(String input, String output, InputType type)
   at Program.<Main>$(String[] args) in /app/Program.cs:line 7

Here's a project. Run the docker.ps1 file in the powershell.
BootstrapEmailExample.zip

Wrong background color is applied to the table generated from body

Hi!
When defining custom classes with the background color and applying them to the body, the table generated from the body has wrong background color. Here's an example and comparison with the web version:
result-test.zip
In the example there's grey background defined as a class in styles and applied to the body. There's also a white card inside.
The code generated from the web is correct, and shows grey background and white card. The code generated with this library has white background around the card too. That happens because the table inside the body has explicit white background being set in the table attributes and style.

Concurrency errors when using precompiled css

Hi!
Tried the sass precompilation approach recently, I get errors when I try to do multiple renderings at the same time, here's an example.
BootstrapEmailExample.zip
The error is: The process cannot access the file 'D:\Projects\BootstrapEmailExample\ConsoleExample\bin\Debug\net8.0\core\bootstrap-email.scss' because it is being used by another process.
I also noticed that if the css files are not found then the usual sass compilation takes place. That can be misleading, can there be a switch that turns off sass in the library, and in case the css files are not found it throws an error? That will help in debugging.
Thanks!

Sass precompilation

Hi!
This library uses file caches for styles that it compiles and creates in the runtime. I presume it was made that way for cli usage primarily, which makes total sense. Unfortunately in my setup it's not possible to precompile templates, as they are rendered with razor components, with layouts and child components. However using cli partially, to precompile sass would be a great thing. I wonder if it's possible with this library.
Thanks!

Table generated from body is missing the style attribute

Hi!
I've noticed there are some differences and errors when compiling templates in this project vs the bootstrapemail.com website. Here's an example, with source html, a result from bootstrapemail.com website, and an html result generated with this library.
result-test.zip

  1. Opening both results in browser reveals that in web result the card is centered and has 600px width, and lib result is not centered, and its width is trimmed to content. That's because the table inside the body does not have a style attribute. Copying the style attribute from the web result makes two results appear identical in the browser.
  2. Body class "bg-light" in source is transferred into table inside body as "bg-light body" in web result, and as "bg-lightbody" in lib result.
  3. Source template does not have DOCTYPE, it's added automatically to the web result, but not to the lib result.

Hope that'll be helpful. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.