Multiple css-files + inline css #241

Merged
merged 1 commit into from Jul 26, 2016

4 participants

@clestial

I made a couple of changes to how options.css works.

These changes makes it possible to include multiple css files and/or inline css, both at the same time.

By setting css: to an array containing strings (css-file) or objects (inline css).
Example:
css: ['/path/to/file1.css','/path/to/file2.css',{'background-color':'#000'}]

Example at http://jsfiddle.net/ttzp5/3/

And it retains backward compatibility.

@clestial clestial Made changes to how option.css works.
It now allows:
- Include multiple css files
- Use both inclusion of css files and inline css simultaneously
by setting css: to an array containg either strings (css-file) or objects (inline css).
Example:
css: ['/path/to/file1.css','/path/to/file2.css',{'background-color':'#000'}]

And it retains backward compatibillity
03013e3
@Tudmotu

I would actually prefer to see these two features implemented separately, i.e.:

$(document).ready(function() {
    $("#test").wysiwyg({
        css: [ "/css/non-existant-1.css", "/css/non-existant-2.css"],
        inline_css: {
            "body": {
                 "background-color": "#FF0000",
             },
             "body h1.title": {
                 "font-weight": "bold"
             }
        }
    });
});

I think it makes more sense, and enables the user to insert custom CSS inside the <style/> tag, which will then be also saved inside the textarea's content.

Yotam

@akzhan
jwysiwyg member

+1 to @Tudmotu.

@clestial, can you rework your code to support inline styles as another option?

@clestial

Yeah, that sounds like an interesting idea. I'll give it a go and see what I can come up with.

@akzhan
jwysiwyg member

@clestial, any news?

@Tudmotu

btw, if implementing this feature, we need to discuss whether the inline-css should be saved in the textarea or not.

Yotam.

@gintsmurans

Inline css would be a really nice feature. For the project I a using it, I just need to add 5px padding from all sides, I don't want to create a new css file just for that.

@akzhan akzhan merged commit ad28ca7 into jwysiwyg:master Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment