plax
plax copied to clipboard
adds left margin to margin-left
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.
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
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.
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.
topandleftare 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
Sorry, I've confused matters here by misunderstanding @arush's problem. I've removed my posts, and will open a new thread.
@arush you could add an intermediate element with {position:relative}, that's how I'd achieve it.
I'll give this some thought. You're more than welcome to submit a pull request for what you suggest in the meantime.