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

Custom Styles #658

Closed
greatislander opened this Issue Feb 13, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@greatislander
Member

greatislander commented Feb 13, 2017

Prerequisites

Description

The Pressbooks Custom CSS theme should be replaced for new users with an 'Custom Styles' feature, that allows additive (S)CSS on top of any theme's built-in stylesheets.

Steps to Reproduce

Not applicable.

System Information

Pressbooks: 4.1
WordPress: 4.8.1
PHP: 7.1

@greatislander greatislander added this to the v3.9.8 milestone Feb 13, 2017

@greatislander greatislander self-assigned this Feb 13, 2017

@greatislander greatislander modified the milestones: 3.9.8, 3.9.9 Apr 3, 2017

@greatislander greatislander modified the milestones: 3.9.9, 4.0 May 25, 2017

@greatislander greatislander modified the milestones: 4.0, 4.1 Jun 21, 2017

@greatislander greatislander modified the milestones: 4.1, 4.2 Jul 17, 2017

@apurvaashok

This comment has been minimized.

Show comment
Hide comment
@apurvaashok

apurvaashok Jul 24, 2017

An example of the code we have removed in the past, in the Christie EBOOK stylesheet is:
ul li li {
list-style-image: url(images/em-dash.png); }

ul li li li {
list-style-image: url(images/asterisk.png); }

apurvaashok commented Jul 24, 2017

An example of the code we have removed in the past, in the Christie EBOOK stylesheet is:
ul li li {
list-style-image: url(images/em-dash.png); }

ul li li li {
list-style-image: url(images/asterisk.png); }

@greatislander

This comment has been minimized.

Show comment
Hide comment
@greatislander

greatislander Jul 24, 2017

Member

Could be overruled by:

ul li li {
  list-style-image: none;
}

ul li li li {
  list-style-image: none;
}
Member

greatislander commented Jul 24, 2017

Could be overruled by:

ul li li {
  list-style-image: none;
}

ul li li li {
  list-style-image: none;
}

@greatislander greatislander changed the title from Additional CSS to Custom Styles Aug 19, 2017

@greatislander

This comment has been minimized.

Show comment
Hide comment
@greatislander

greatislander Aug 19, 2017

Member

Mockup

custom styles

Notes

  • Top block (Theme Styles) contains the compiled stylesheet for the selected format, and is NOT editable by the user (this will necessitate a separate compilation routine which excludes the custom styles so that we don't end up in INCEPTION).
  • Bottom block (Your Styles) contains user-editable style rules which are appended to the end of the theme stylesheet for the selected format prior to compiling for export.
  • Custom style rules will be saved in a custom post type created for this feature (custom-style).
  • The theme style viewer and the custom styles editor will both use CodeMirror for syntax highlighting and (for the editor) linting (see implementation here). It looks like CodeMirror will be bundled with WordPress 4.9 (see Trac #12423) but for now we will have to include it ourselves.
  • Export routines will append the user's custom styles to the theme stylesheet prior to compilation. For the webbook stylesheet, a recompile will be triggered whenever the user saves custom styles targeting web.
  • OPTIONAL: Custom style rules can be added in either CSS or SCSS. A post meta key (pb_custom_style_style_format) will be used to indicate to Pressbooks whether the user has selected CSS or SCSS.
Member

greatislander commented Aug 19, 2017

Mockup

custom styles

Notes

  • Top block (Theme Styles) contains the compiled stylesheet for the selected format, and is NOT editable by the user (this will necessitate a separate compilation routine which excludes the custom styles so that we don't end up in INCEPTION).
  • Bottom block (Your Styles) contains user-editable style rules which are appended to the end of the theme stylesheet for the selected format prior to compiling for export.
  • Custom style rules will be saved in a custom post type created for this feature (custom-style).
  • The theme style viewer and the custom styles editor will both use CodeMirror for syntax highlighting and (for the editor) linting (see implementation here). It looks like CodeMirror will be bundled with WordPress 4.9 (see Trac #12423) but for now we will have to include it ourselves.
  • Export routines will append the user's custom styles to the theme stylesheet prior to compilation. For the webbook stylesheet, a recompile will be triggered whenever the user saves custom styles targeting web.
  • OPTIONAL: Custom style rules can be added in either CSS or SCSS. A post meta key (pb_custom_style_style_format) will be used to indicate to Pressbooks whether the user has selected CSS or SCSS.

@connerbw connerbw assigned greatislander and unassigned connerbw Aug 31, 2017

@connerbw

This comment has been minimized.

Show comment
Hide comment
@connerbw

connerbw Aug 31, 2017

Member

PR:
#912

Suggestion: Don't merge until after eCampus/Pressbooks demo day. This change is pretty big and I'd like it to sit on the testing server for a week or two before going out for release.

Member

connerbw commented Aug 31, 2017

PR:
#912

Suggestion: Don't merge until after eCampus/Pressbooks demo day. This change is pretty big and I'd like it to sit on the testing server for a week or two before going out for release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment