WordPress.org

Ready to get started?Download WordPress

Forums

Crayon Syntax Highlighter
[resolved] Custom CSS breaks with parens in theme name (2 posts)

  1. michaelsanford
    Member
    Posted 1 year ago #

    Minor issue. I just created a custom Crayon theme by duplicating an existing template and calling it While (1).

    The jQuery UI widgets in the theme creator rendered properly and the colours in the widgets seemed to correctly reflect the original theme's colour selections.

    However, the live preview in the admin page and the existing crayons in posts were all completely unstyled. I fixed it by reduplicating the same original theme and giving it While One as a name.

    Enjoy!

    http://wordpress.org/extend/plugins/crayon-syntax-highlighter/

  2. akarmenia
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, that's fixed now - if you try to name it "While (1)" it will name it "While 1". This is because CSS element names can't have parentheses and I've tried to keep the structure standardised with the folder names for themes. This means you can only use alphanumerics and spaces in the names of Themes. When Crayon looks through the themes folder to populate the dropdown of themes, it only checks the filenames to construct the theme names until you load the actual theme. This means the id and name functions are bijective and inverse:

    f(id) = name
    g(name) = id
    f(g(name)) = name
    g(f(id)) = id

    f(x) takes an id and replaces hyphens with spaces and turns it into Title Case.
    g(x) takes a name and replaces spaces with hyphens and turns it to lowercase.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.