Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #40354 > unrolled thread

Using CSS clamp retrospectively

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2021-08-24 19:53 +1000
Last post2021-09-01 05:10 +0200
Articles 7 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  Using CSS clamp retrospectively Andrew Poulos <ap_prog@hotmail.com> - 2021-08-24 19:53 +1000
    Re: Using CSS clamp retrospectively Julio Di Egidio <julio@diegidio.name> - 2021-08-24 09:32 -0700
      Re: Using CSS clamp retrospectively Andrew Poulos <ap_prog@hotmail.com> - 2021-08-25 08:04 +1000
        Re: Using CSS clamp retrospectively Julio Di Egidio <julio@diegidio.name> - 2021-08-24 19:21 -0700
          Re: Using CSS clamp retrospectively Andrew Poulos <ap_prog@hotmail.com> - 2021-08-26 08:05 +1000
            Re: Using CSS clamp retrospectively Julio Di Egidio <julio@diegidio.name> - 2021-08-26 03:37 -0700
    Re: Using CSS clamp retrospectively Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-09-01 05:10 +0200

#40354 — Using CSS clamp retrospectively

FromAndrew Poulos <ap_prog@hotmail.com>
Date2021-08-24 19:53 +1000
SubjectUsing CSS clamp retrospectively
Message-ID<v6qdnT1n-MQFXLn8nZ2dnUU7-bXNnZ2d@westnet.com.au>
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

[toc] | [next] | [standalone]


#40355

FromJulio Di Egidio <julio@diegidio.name>
Date2021-08-24 09:32 -0700
Message-ID<3bf83ff7-999c-44d7-85a1-3d2dd28e6486n@googlegroups.com>
In reply to#40354
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

[toc] | [prev] | [next] | [standalone]


#40356

FromAndrew Poulos <ap_prog@hotmail.com>
Date2021-08-25 08:04 +1000
Message-ID<KL6dnauri7Z_8bj8nZ2dnUU7-K3NnZ2d@westnet.com.au>
In reply to#40355
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

[toc] | [prev] | [next] | [standalone]


#40357

FromJulio Di Egidio <julio@diegidio.name>
Date2021-08-24 19:21 -0700
Message-ID<c47ff3d1-cc1c-494c-8e75-c16edd73a6b7n@googlegroups.com>
In reply to#40356
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

[toc] | [prev] | [next] | [standalone]


#40359

FromAndrew Poulos <ap_prog@hotmail.com>
Date2021-08-26 08:05 +1000
Message-ID<W6-dnfKWcK8_I7v8nZ2dnUU7-bfNnZ2d@westnet.com.au>
In reply to#40357
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

[toc] | [prev] | [next] | [standalone]


#40360

FromJulio Di Egidio <julio@diegidio.name>
Date2021-08-26 03:37 -0700
Message-ID<60a31198-969c-450a-9188-cb39553e585bn@googlegroups.com>
In reply to#40359
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

[toc] | [prev] | [next] | [standalone]


#40364

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2021-09-01 05:10 +0200
Message-ID<2409565.ZsQzgUTt8z@PointedEars.de>
In reply to#40354
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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web