plax icon indicating copy to clipboard operation
plax copied to clipboard

adds left margin to margin-left

Open arush opened this issue 13 years ago • 6 comments

I use margin to position my absolute elements, I've found it to be better in many scenarios than using left:0; top:0; etc...

When using plax, in Chrome and Safari (not FF) plax adds the 'left: 362px' where i have margin-left: 362px , therefore making it positioned too far left by 362px (its total margin is now 724px).

This is really annoying.

arush avatar Dec 06 '11 21:12 arush

I'm not great with regex stuff sorry!

Sent from my iPhone

On 20 Mar 2012, at 10:37, Phil Ricketts [email protected] wrote:

The reason it affects margin-left (I think), is because it does a regexp match on 'left' and 'top' - so values associated with 'margin-left' and 'margin-top' will get picked up by this.

Not too hard to fix it if you want to look into it, arush?


Reply to this email directly or view it on GitHub: https://github.com/cameronmcefee/plax/issues/16#issuecomment-4592542

arush avatar Mar 20 '12 11:03 arush

Hi Guys,

There's no regex. It's specifically targeting the top and left properties. I'm hesitant to support margins as a positioning method. top and left are css properties specifically designed for coordinate positioning, whereas using margins is technically a workaround.

@arush Can you provide specific examples of why it would be better to support margin-based positioning.

cameronmcefee avatar Mar 23 '12 16:03 cameronmcefee

Margins provide a completely different positioning functionality which is impossible to achieve through the use of top and left for an absolutely positioned element when it is surrounded by a relatively positioned element. I'm sorry I don't really know how else to explain it without an example and I have since redesigned my example!

Sent from my iPhone

On 23 Mar 2012, at 16:42, Cameron McEfee [email protected] wrote:

Hi Guys,

There's no regex. It's specifically targeting the top and left properties. I'm hesitant to support margins as a positioning method. top and left are css properties are specifically designed for coordinate positioning, whereas using margins is technically a workaround.

@arush Can you provide specific examples of why it would be better to support margin-based positioning.


Reply to this email directly or view it on GitHub: https://github.com/cameronmcefee/plax/issues/16#issuecomment-4662900

arush avatar Mar 23 '12 16:03 arush

Sorry, I've confused matters here by misunderstanding @arush's problem. I've removed my posts, and will open a new thread.

replete avatar Mar 23 '12 17:03 replete

@arush you could add an intermediate element with {position:relative}, that's how I'd achieve it.

replete avatar Mar 23 '12 17:03 replete

I'll give this some thought. You're more than welcome to submit a pull request for what you suggest in the meantime.

cameronmcefee avatar Mar 23 '12 17:03 cameronmcefee