Code Monkey home page Code Monkey logo

Comments (2)

ryangurn avatar ryangurn commented on July 19, 2024

I now figured out that I just need to do one style for each of the classes rather than attempt to do arrays. It would be nice if the following features could be added to the roadmap.

  1. Allow for overriding base tool classes or overall tags
  2. Allow for defining compound Style's that allow for arrays of classes all meant to be applied to the given element.
  3. Setup some structure for allowing complex overriding of tags for handling CSS frameworks (with, in my opinion too many classes to define using the current syntax)
  4. Add some methodology for handing responsive classes that generally are just mutations of other classes.
  5. Add a simple search feature to properties modal to handle the plethora of classes to go through.

I have used bootstrap, foundation, and most currently tailwind and find that there are many styles that I would want just for text manipulation and that creates the following over redundant code. Some simple ability to load a json file would be wonderful and probably help with the effective file sizes for the editor.js file.

** NOTE: this is not even all of the text manipulation styles that I ended up adding **

    ContentTools.StylePalette.add([
        new ContentTools.Style('Text Extra Small', 'text-xs', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Small', 'text-sm', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Normal', 'text-base', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Large', 'text-lg', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Extra Large', 'text-xl', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text 2x', 'text-2xl', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text 3x', 'text-3xl', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text 4x', 'text-4xl', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text 5x', 'text-5xl', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text 6x', 'text-6xl', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Antialiased', 'antialiased', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Pixel Antialiased', 'subpixel-antialiased', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Italic', 'italic', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Text Not Italic', 'not-italic', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Hairline', 'font-hairline', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Thin', 'font-thin', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Light', 'font-light', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Normal', 'font-normal', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Medium', 'font-medium', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Semibold', 'font-semibold', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Bold', 'font-bold', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Extra Bold', 'font-extrabold', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),
        new ContentTools.Style('Font Very Bold', 'font-black', ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'span']),

    ]);

Unfortunately attempting to minify the javascript we really don't get it that small (only about 18% compression)

new ContentTools.Style("Text Extra Small","text-xs",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Small","text-sm",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Normal","text-base",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Large","text-lg",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Extra Large","text-xl",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text 2x","text-2xl",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text 3x","text-3xl",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text 4x","text-4xl",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text 5x","text-5xl",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text 6x","text-6xl",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Antialiased","antialiased",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Pixel Antialiased","subpixel-antialiased",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Italic","italic",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Text Not Italic","not-italic",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Hairline","font-hairline",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Thin","font-thin",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Light","font-light",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Normal","font-normal",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Medium","font-medium",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Semibold","font-semibold",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Bold","font-bold",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Extra Bold","font-extrabold",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Font Very Bold","font-black",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Normal Numbers","normal-nums",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Ordinal","ordinal",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Slashed Zero","slashed-zero",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Lining figures","lining-nums",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Oldstyle figures","oldstyle-nums",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Proportional figures","proportional-nums",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Tabular figures","tabular-nums",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Diagonal fractions","diagonal-fractions",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Stacked fractions","stacked-fractions",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Tracking Tighter","tracking-tighter",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Tracking Tight","tracking-tight",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Tracking Normal","tracking-normal",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Tracking Wide","tracking-wide",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Tracking Wider","tracking-wider",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Tracking Widest","tracking-widest",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 3","leading-3",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 4","leading-4",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 5","leading-5",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 6","leading-6",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 7","leading-7",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 8","leading-8",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 9","leading-9",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height 10","leading-10",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height None","leading-none",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height Tight","leading-tight",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height Snug","leading-snug",["p","h1","h2","h3","h4","h5","span"]),new ContentTools.Style("Line Height Normal","leading-normal",["p","h1","h2","h3","h4","h5","span"]);

I wish I could help implement many of these features but at this point, I don't have enough experience with this project to properly contribute quality code. I hope this helps.

from contenttools.

john3parker avatar john3parker commented on July 19, 2024

+1 on a feature to add multiple classes to an element. I'm using Bootstrap with ContentTools and many require multiple classes to be effective. For example, to make an anchor tag look like a button with primary color you need to add both "btn" and "btn-primary" classes.

from contenttools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.