Giter VIP home page Giter VIP logo

Comments (8)

G-Ambatte avatar G-Ambatte commented on September 26, 2024

I have so far been unable to develop a CSS selector to target the first letter only when it is styled. However I suspect the easiest solution is to instead simply remove any such styling from the drop cap, so it is never italicized.

from homebrewery.

5e-Cleric avatar 5e-Cleric commented on September 26, 2024

you can't style based on applied styles, unless they are set in inline styles:

.page .element[style*="color:red;"] {} should work fine.

But that does not work for the ::first-letter pseudo-selector.

A solution would be to fix this for manual cursive, but not for programatic one:

# This is a test

*T*his test will try to find a solution for the drop cap clip when you use cursive.

This one outputs an em element inside the P, and can be styled easily. And somehow counts the T as first-letter, so it can be styled with .page h1+p:has(em)::first-letter.

from homebrewery.

G-Ambatte avatar G-Ambatte commented on September 26, 2024

I was attempting to use something like .page h1+p:has(em:first-child)::first-letter to target only first letters that were italicized, but it seems that the text elements inside a p don't count as children, so ANY p that contained an em was targeted.

from homebrewery.

Gazook89 avatar Gazook89 commented on September 26, 2024

Is it easier to create a distinct font variant of that drop cap font, italic? Then could bake in better spacing. Rather than relying on browser to fake the italic.

from homebrewery.

G-Ambatte avatar G-Ambatte commented on September 26, 2024

I suspect that the easiest solution is simply to remove the italicization, with the primary justification that no drop cap in any official source book is italicized, and secondary justifications that the kerning between two different fonts is difficult to manage, even more so with additional text styling.

from homebrewery.

Gazook89 avatar Gazook89 commented on September 26, 2024

K. I also agree that italicizing the drop cap makes no sense. I don’t think we need to do anything here— just tell users not to include it in the italic syntax.

from homebrewery.

5e-Cleric avatar 5e-Cleric commented on September 26, 2024

I could give a try to making an italicized version, but i agree there is no point in having that option.

If we are going to enforce the no-italics rule, we might as well force caps too, text-transform:uppercase is a great piece of code.

from homebrewery.

Gazook89 avatar Gazook89 commented on September 26, 2024

I don’t think we should enforce anything. It’s easy enough to just not include the letter in the italics. If we have weird hidden rules it’s only going to confuse people who want to do something a little different, with different fonts or whatever.

from homebrewery.

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.