• Using CSS clamp retrospectively

    From Andrew Poulos@21:1/5 to All on Tue Aug 24 19:53:27 2021
    I've been experimenting with the CSS function clamp(). After a few false
    starts I'm won over by how it allows fluid typography.

    At a recent meeting I discussed the merits of clamp and I've been asked
    to apply clamp in our current project.

    The project has: extensive style sheets; JavaScript which does
    modification of existing font sizing; and, it accepts pasting in text
    (with formatting: size colour, font...).

    I suppose I can edit the style sheets, and search through the code and
    edit any instance that sets a font size, and finally post process any
    pasted text but is there some way that doesn't require me to go through thousands of line of code one line at a time?

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julio Di Egidio@21:1/5 to Andrew Poulos on Tue Aug 24 09:32:43 2021
    On Tuesday, 24 August 2021 at 11:53:40 UTC+2, Andrew Poulos wrote:
    I've been experimenting with the CSS function clamp(). After a few false starts I'm won over by how it allows fluid typography.

    At a recent meeting I discussed the merits of clamp and I've been asked
    to apply clamp in our current project.

    The project has: extensive style sheets; JavaScript which does
    modification of existing font sizing; and, it accepts pasting in text
    (with formatting: size colour, font...).

    I suppose I can edit the style sheets, and search through the code and
    edit any instance that sets a font size, and finally post process any
    pasted text but is there some way that doesn't require me to go through thousands of line of code one line at a time?

    Well, more than the number of lines of code, what matters is how many instance there are that you need to change, and those I suppose you can find with a plain find across files.

    - Should you have many in the style sheets and you also have solid criteria for finding and modification, you could automate with a script (could be JS itself in Node): but maybe even just a (one or few) replace across files with regular expressions
    might do the trick, in which case all you need is an IDE that supports it.

    - For the JS code I would expect you'd have to touch very few places, if the code is not just a wild mess: in which case, also for more safety, you may just want to do it by hand.

    I'd also suggest you put together a little test plan, the 4-5 test cases to check that all works as expected (not even need to automate it, unless you prefer so).

    HTH,

    Julio

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew Poulos@21:1/5 to Julio Di Egidio on Wed Aug 25 08:04:15 2021
    On 25/08/2021 2:32 am, Julio Di Egidio wrote:
    On Tuesday, 24 August 2021 at 11:53:40 UTC+2, Andrew Poulos wrote:
    I've been experimenting with the CSS function clamp(). After a few false
    starts I'm won over by how it allows fluid typography.

    At a recent meeting I discussed the merits of clamp and I've been asked
    to apply clamp in our current project.

    The project has: extensive style sheets; JavaScript which does
    modification of existing font sizing; and, it accepts pasting in text
    (with formatting: size colour, font...).

    I suppose I can edit the style sheets, and search through the code and
    edit any instance that sets a font size, and finally post process any
    pasted text but is there some way that doesn't require me to go through
    thousands of line of code one line at a time?

    Well, more than the number of lines of code, what matters is how many instance there are that you need to change, and those I suppose you can find with a plain find across files.

    - Should you have many in the style sheets and you also have solid criteria for finding and modification, you could automate with a script (could be JS itself in Node): but maybe even just a (one or few) replace across files with regular expressions
    might do the trick, in which case all you need is an IDE that supports it.

    - For the JS code I would expect you'd have to touch very few places, if the code is not just a wild mess: in which case, also for more safety, you may just want to do it by hand.

    I'd also suggest you put together a little test plan, the 4-5 test cases to check that all works as expected (not even need to automate it, unless you prefer so).

    Thanks, you've confirmed for me that there's no simple way to make the
    changes ;-)

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julio Di Egidio@21:1/5 to Andrew Poulos on Tue Aug 24 19:21:07 2021
    On Wednesday, 25 August 2021 at 00:04:30 UTC+2, Andrew Poulos wrote:
    On 25/08/2021 2:32 am, Julio Di Egidio wrote:
    On Tuesday, 24 August 2021 at 11:53:40 UTC+2, Andrew Poulos wrote:
    I've been experimenting with the CSS function clamp(). After a few false >> starts I'm won over by how it allows fluid typography.

    At a recent meeting I discussed the merits of clamp and I've been asked >> to apply clamp in our current project.

    The project has: extensive style sheets; JavaScript which does
    modification of existing font sizing; and, it accepts pasting in text
    (with formatting: size colour, font...).

    I suppose I can edit the style sheets, and search through the code and
    edit any instance that sets a font size, and finally post process any
    pasted text but is there some way that doesn't require me to go through >> thousands of line of code one line at a time?

    Well, more than the number of lines of code, what matters is how many instance there are that you need to change, and those I suppose you can find with a plain find across files.

    - Should you have many in the style sheets and you also have solid criteria for finding and modification, you could automate with a script (could be JS itself in Node): but maybe even just a (one or few) replace across files with regular expressions
    might do the trick, in which case all you need is an IDE that supports it.

    - For the JS code I would expect you'd have to touch very few places, if the code is not just a wild mess: in which case, also for more safety, you may just want to do it by hand.

    I'd also suggest you put together a little test plan, the 4-5 test cases to check that all works as expected (not even need to automate it, unless you prefer so).

    Thanks, you've confirmed for me that there's no simple way to make the changes ;-)

    Sure there is: just pay a professional to do it for you.

    When one is too smart not to be a stupid fuck...

    *Plonk*

    Julio

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew Poulos@21:1/5 to Julio Di Egidio on Thu Aug 26 08:05:20 2021
    On 25/08/2021 12:21 pm, Julio Di Egidio wrote:
    On Wednesday, 25 August 2021 at 00:04:30 UTC+2, Andrew Poulos wrote:
    On 25/08/2021 2:32 am, Julio Di Egidio wrote:
    On Tuesday, 24 August 2021 at 11:53:40 UTC+2, Andrew Poulos
    wrote:
    I've been experimenting with the CSS function clamp(). After a
    few false starts I'm won over by how it allows fluid
    typography.

    At a recent meeting I discussed the merits of clamp and I've
    been asked to apply clamp in our current project.

    The project has: extensive style sheets; JavaScript which does
    modification of existing font sizing; and, it accepts pasting
    in text (with formatting: size colour, font...).

    I suppose I can edit the style sheets, and search through the
    code and edit any instance that sets a font size, and finally
    post process any pasted text but is there some way that doesn't
    require me to go through thousands of line of code one line at
    a time?

    Well, more than the number of lines of code, what matters is how
    many instance there are that you need to change, and those I
    suppose you can find with a plain find across files.

    - Should you have many in the style sheets and you also have
    solid criteria for finding and modification, you could automate
    with a script (could be JS itself in Node): but maybe even just a
    (one or few) replace across files with regular expressions might
    do the trick, in which case all you need is an IDE that supports
    it.

    - For the JS code I would expect you'd have to touch very few
    places, if the code is not just a wild mess: in which case, also
    for more safety, you may just want to do it by hand.

    I'd also suggest you put together a little test plan, the 4-5
    test cases to check that all works as expected (not even need to
    automate it, unless you prefer so).

    Thanks, you've confirmed for me that there's no simple way to make
    the changes ;-)

    Sure there is: just pay a professional to do it for you.

    When one is too smart not to be a stupid fuck...

    No, you misunderstand. They thought they I could just code something
    that could easily do it. The process you've set out is exactly what I
    needed to show them that while it is do-able it isn't trivially so.

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julio Di Egidio@21:1/5 to Andrew Poulos on Thu Aug 26 03:37:56 2021
    On Thursday, 26 August 2021 at 00:05:34 UTC+2, Andrew Poulos wrote:
    On 25/08/2021 12:21 pm, Julio Di Egidio wrote:
    On Wednesday, 25 August 2021 at 00:04:30 UTC+2, Andrew Poulos wrote:
    On 25/08/2021 2:32 am, Julio Di Egidio wrote:
    <snip>
    automate it, unless you prefer so).

    Thanks, you've confirmed for me that there's no simple way to make
    the changes ;-)

    Sure there is: just pay a professional to do it for you.

    When one is too smart not to be a stupid fuck...

    No, you misunderstand.

    No, it's you who can't write sensibly and respectfully. As usual.

    The process you've set out is exactly what I
    needed to show them that while it is do-able it isn't trivially so.

    Glad it helped. As usual.

    *Plonk*

    Julio

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas 'PointedEars' Lahn@21:1/5 to Andrew Poulos on Wed Sep 1 05:10:57 2021
    Andrew Poulos wrote:

    The project has: extensive style sheets; JavaScript which does
    modification of existing font sizing; and, it accepts pasting in text
    (with formatting: size colour, font...).

    I suppose I can edit the style sheets, and search through the code and
    edit any instance that sets a font size, and finally post process any
    pasted text but is there some way that doesn't require me to go through thousands of line of code one line at a time?

    The main problem is the initial decision to not use a dynamic stylesheet language like LESS or SASS to make the font sizes depend on each other, or
    at least to be able to change only variable definitions.

    So now there is no way other than clever search-and-replace operations in
    all stylesheet files using regular expressions.

    --
    PointedEars
    FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix> <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
    Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)