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

CSS Commenting + New "Style Editor" snippet menu #1572

Merged
merged 12 commits into from
Sep 22, 2021
Merged

CSS Commenting + New "Style Editor" snippet menu #1572

merged 12 commits into from
Sep 22, 2021

Conversation

Gazook89
Copy link
Collaborator

This builds on PR #1562, awaiting approval.

image

*my local docker build has issues with font-awesome icons...

Changes

  • Renames the "Editor" menu on the text editor to "Text Editor".
  • Creates a new snippet menu in the style editor, "Style Editor".
  • Moves the Drop Cap snippets to the new "Style Editor" menu.
  • Adds a new snippet "Add Comment" to the Style Editor menu that creates a CSS Comment template.
  • Minor changes related to the above, and removing some old code comments I left in a previous PR that are not necessary.

Places for improvement

Commenting hotkeys should be updated to reflect the editor pane that is open, so html comments are used in the Text Editor and css comments are used in the Style Editor.

And other tweaks:
- Move drop caps snippets to Style Editor menu
- retitle Editor menu to either Text Editor or Style Editor
- minor:  removed old unnecessary comments in code from earlier (my own).
- Removed leading spaces on drop cap comment
- added drop cap comment on "remove drop caps" snippet.
Matching legacy to v3 (adds another menu to style editor, etc).
Removed reference to hotkeys for commenting in the Style Editor since that is not implemented yet.  can be added back to match the Text Editor commenting snippet once implemented.
@calculuschild calculuschild changed the base branch from master to PRODUCTION August 27, 2021 19:10
@calculuschild calculuschild changed the base branch from PRODUCTION to master August 27, 2021 19:10
@calculuschild
Copy link
Member

Commenting hotkeys should be updated to reflect the editor pane that is open, so html comments are used in the Text Editor and css comments are used in the Style Editor.

Yes we should do this but it can be a separate PR to avoid cluttering this one up. We would just need to pass in the view property to the codeEditor component similar to how we pass it in to the snippetBar component.

and change v3 drop cap to use only `background` rather than `background-image` so that the tweak snippet can easily change between gradient and just a regular color.

and re-order table menu so that the regular table snippet is at top.
@Gazook89
Copy link
Collaborator Author

Gazook89 commented Sep 5, 2021

Just remembered you asked for some dedents here, working on that.

Out of curiosity, what is the difference between this:

gen  : function(){
	    return dedent`
		    {{descriptive
		    ##### Time to Drop Knowledge
		    Use descriptive boxes to highlight text that should be read aloud.
    
		    **Tables and lists** both work within a descriptive box.
		    }}
		    \n`;
    },

and:

gen  : dedent`{{descriptive
		##### Time to Drop Knowledge
		Use descriptive boxes to highlight text that should be read aloud.

		**Tables and lists** both work within a descriptive box.
		}}
		\n`

I see both are used, but no obvious difference.

Gazook89 and others added 4 commits September 15, 2021 15:45
having `.pages` included in the selector did not match the selectivity in the base .less sheet.  Oddly, it was working in the Edit Page, but not in the Print Page.
@calculuschild calculuschild changed the base branch from master to PRODUCTION September 22, 2021 02:56
@calculuschild calculuschild changed the base branch from PRODUCTION to master September 22, 2021 02:56
@calculuschild
Copy link
Member

calculuschild commented Sep 22, 2021

Out of curiosity, what is the difference between [dedent styles]

No real difference. The way it's processed is slightly different, but the result is the same. Probably cleanest to just not use function if it seems to work without it.

As for

dedent`
  {{descriptive

vs

dedent`{{descriptive

They are handled the same; dedent ignores the first line if it is empty. Just a difference of which one you prefer for legibility. (first option takes fewer lines, second option lets you align the first line of text better)

Changing to just `background` undoes `background-clip` as well. This is more explicit.
@calculuschild calculuschild merged commit 7232326 into naturalcrit:master Sep 22, 2021
@calculuschild
Copy link
Member

Merged! Thanks @Gazook89 🎉

@Gazook89 Gazook89 deleted the Style-Editor-Menu-and-comments branch September 22, 2021 18:39
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

Successfully merging this pull request may close these issues.

2 participants