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

outsource note styles to css #9

Closed
julkue opened this issue Feb 9, 2016 · 7 comments
Closed

outsource note styles to css #9

julkue opened this issue Feb 9, 2016 · 7 comments

Comments

@julkue
Copy link
Contributor

julkue commented Feb 9, 2016

The documentation shows how to style a note:

    //Config note style
    style : {
        tresd           : true,                 //General style in 3d format
        backgroundcolor : '#FFFA3C',            //Background color in new postits when randomColor = false
        textcolor       : '#333333',            //Text color
        textshadow      : true,                 //Shadow in the text
        fontfamily      : 'verdana',            //Default font
        fontsize        : 'small',              //Default font size
        arrow           : 'none',               //Default arrow : none, top, right, bottom, left
    }

However, this seems to be not really modern. If you want to style your note you will come to a point, where things like that aren't enough (e.g. you could need a box-shadow).
The way a note looks should be defined in a CSS class instead of a JS configuration.

@txusko
Copy link
Owner

txusko commented Feb 10, 2016

But these variables can be configured on the fly from the back-panel configuration. Some are embebed in the style attribute of the element, and others are adding or removing css classes, for example the "3d" style, the textshadow, etc. Do you have any idea about it?

@julkue
Copy link
Contributor Author

julkue commented Feb 10, 2016

Basically you should not define CSS in the plugin. Instead, just add CSS classes to an element. That allows designers to style notes with pure CSS, they just need to know what class will be added to what element.

Take this project as an example. It highlights keywords. Now in your way this plugin would just offer to change e.g. the color with an option. But this will mix up styling and scripting, which is bad. Also it makes it harder to maintain and integration can be difficult. On top, as I already said, when designers want to add CSS that your plugin doesn't provide, they would have to adjust the plugin. This is why this project simply allows to pass a class name. Then styling is a completely separate thing and nothing is mixed together.

The plugin should allow users to define there own CSS for the look and feel of notes. This includes options like position, posX, posY, right, height, width, minHeight, minWidth, style.

@julkue
Copy link
Contributor Author

julkue commented Mar 14, 2016

For me, this is the most fundamental issue. Customers expect a feature to look like their StyleGuide and styling a note with the current implementation seems to be expensive and cumbersome, functions and styles should be splitted (JS, CSS) as long as possible.

@txusko
Copy link
Owner

txusko commented Aug 31, 2016

Sorry, I was working to outsource the note style to a css class. Still much work to be done, but when you can, If you take a look at this branch and tell me if I'm in the right direction.

https://github.com/txusko/PostItAll/tree/Outsource-note-styles-to-css
Examples in https://github.com/txusko/PostItAll/blob/Outsource-note-styles-to-css/examples/cssnote.html

@julkue
Copy link
Contributor Author

julkue commented Sep 1, 2016

@txusko Thank you for your work! I've seen there's a great progress. Unfortunately I'm currently not able to review the things due to lack of time.

@txusko
Copy link
Owner

txusko commented Sep 3, 2016

Don't worry @julmot I'll continue working and try to do my best. 👍

@txusko
Copy link
Owner

txusko commented Jan 21, 2018

Branch d6a7a82 merged & new version published.
Regards!

@txusko txusko closed this as completed Jan 21, 2018
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