Skip to content

Comments

[4.0] Cassiopea: adding margin to back-top#27315

Closed
infograf768 wants to merge 2 commits intojoomla:4.0-devfrom
infograf768:4.0_cassiopea_back-top
Closed

[4.0] Cassiopea: adding margin to back-top#27315
infograf768 wants to merge 2 commits intojoomla:4.0-devfrom
infograf768:4.0_cassiopea_back-top

Conversation

@infograf768
Copy link
Member

Summary of Changes

As title says.

Before patch

LTR

Screen Shot 2019-12-19 at 11 43 29

RTL
Screen Shot 2019-12-19 at 11 43 45

After patch

LTR

Screen Shot 2019-12-19 at 11 34 29

RTL

Screen Shot 2019-12-19 at 11 34 52

@C-Lodder
Copy link
Member

With the amount of margins that have been tweaked for RTL, I don't know why you don't just create a SCSS mixin

@C-Lodder
Copy link
Member

Something I've quickly mocked up if you are interested.

Mixin:

@mixin margin($position, $size) {
  margin-#{$position}: $size;
  
  $rtl-position: null;
  @if $position == 'left' {
    $rtl-position: right;
  } @else if $position == 'right' {
    $rtl-position: left;
  }

  @if $rtl-position != null {
    [dir=rtl] & {
      margin-#{$rtl-position}: $size;
    }
  }
}

Random element class:

.myClass {
  display: block;
  @include margin('left', 2rem);
}

This will add your desired RTL code and ignore top and bottom

@infograf768
Copy link
Member Author

@C-Lodder
Sorry, but this kind of code is above my skills.
I can close this if you like and let you propose a new PR.

@brianteeman
Copy link
Contributor

Closed as we have a new pr

@brianteeman brianteeman closed this Feb 8, 2020
@infograf768 infograf768 deleted the 4.0_cassiopea_back-top branch February 9, 2020 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants