Code Monkey home page Code Monkey logo

mechanical-ragger's People

Contributors

danielgamage avatar mikabusante avatar sskylar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mechanical-ragger's Issues

problematic `line-height` values

window.getComputedStyle doesn't always return a pixel value, particularly when it evaluates to normal.

style value getComputedStyle value
18px
inherit 18px
initial normal
normal normal
revert 18px
unset 18px

mechanical-ragger fails for this test case (since normal evaluates to NaN).

Error reading "core.ts:53 Uncaught RangeError: Invalid array length"

MDN suggests that the default is ~1.2, but chrome uses something closer to 1.16 ๐Ÿฅด

normal

Depends on the user agent. Desktop browsers (including Firefox) use a default value of roughly 1.2, depending on the element's font-family.

โ€” https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#values

Either way, relying on all UAs to use a reliable default here feels risky, so maybe we should log a warning in the console and not try to render the exclusion if we can't figure out the line-height? and probably update the README to note this.

inheriting other styles

Any text I place within the <mechanical-ragger> element won't inherit the other styles on my site. For example:

<p><mechanical-ragger>
    This <a href="github.com">URL</a> won't be styled like my other links.
</mechanical-ragger></p>

As far as I understand it, mechanical-ragger creates an autonomous custom element, which won't inherit anything from other HTML elements. But I'd love to be able to integrate this tool's ragging with all my existing styles. Thanks!

Add module tests

should probably test a few uses of the module on every push:

  • minimal react example
  • minimal web component example
  • web component auto-register example

just need to ensure they render, but maybe testing for the existence of the exclusion element would be useful? a visual diffing test might be ideal but maybe more trouble to set up than it's worth?

try `lh` units (in the future)

lh units might be helpful for a few different issues like #3 and #18, where browser differences in how they evaluate, report, and round line heights cause issues for us. we may get mileage out of:

  1. overestimating the amount of lines that need to be rendered, then
  2. generating exclusions that use lh units, which should mirror browser rendering

toggle broken in safari

noted before, but this is borked

Screen Shot 2021-12-01 at 15 47 50

think an svg would actually be a good candidate here, because transitioning a circle's width property alongside vector-effect: non-scaling-stroke would feel a little more harmonious with the motif of the site, and svg is probably less error-prone than trying to leverage backface visibility

Support vertical writing modes

eg:

image

we should leverage block/inline css properties but may have to manually switch the polygon shape based on tb/lr text direction

support text alignments besides left

the basic demo with text-align: right isn't quite what we want. should make sure we know which side of the paragraph the rags (plural none if it's centered?) are going to be on

Screen Shot 2021-12-01 at 15 52 41

some considerations:

  • RTL writing modes like for arabic.
    • is there a difference analytically between css writing-mode and inferred writing mode when you just plop RTL text into a LTR document?
  • text-align: center needs two exclusions

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.