Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded custom CSS gets overridden by the script-generated CSS #62

Open
onet4 opened this issue Jun 11, 2016 · 1 comment
Open

Embedded custom CSS gets overridden by the script-generated CSS #62

onet4 opened this issue Jun 11, 2016 · 1 comment

Comments

@onet4
Copy link

onet4 commented Jun 11, 2016

It seems embedded CSS inserted in the head tag gets overridden by the script's default style.

<head>
    <style>
        .cp-color-picker {
            border: 1px solid #999;
            padding: 8px;
            box-shadow: 5px 5px 16px rgba(0,0,0,0.4);
            background: #eee;
            overflow: visible;
            border-radius: 3px;
            margin: 5px 0 0;
        }
     ...
    </style>
</head>

Linked CSS is fine on the other hand.

<head>
    <link id="colorPickerMod" rel="stylesheet" type="text/css" href="mod.css">
</head>

To fix it, a workaround I found is to insert the following code to the buildCallback callback.

     $( '#tinyColorPickerStyles' ).detach().prependTo( $( 'head' ) );

This can be easily fixed in the core by changing the following line,

        $('head').append('<style type="text/css" id="tinyColorPickerStyles">' +

to

        $('head').prepend('<style type="text/css" id="tinyColorPickerStyles">' +
@PitPik
Copy link
Owner

PitPik commented Aug 30, 2016

Hi @onet4 ,
I added a new option where you can decide where to add the css to not overwrite it:
cssPrepend: not set or false is like before, set to true makes the CSS prepend to the .

Cheers and thanks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants