Giter Site home page Giter Site logo

Comments (9)

AllanPooley avatar AllanPooley commented on May 28, 2024

Hi Nigel,

For the mean time I have developed an inferior, dumbed down (removed functionality I have no use-cases for, such as angle-position-y) mixin that uses percentages instead of vw.

The behaviour is quite different from your mixin, but it seems to have solved my iOS / Safari woes.

@mixin primitive-angled-slant($angle, $angle-position-x) {
  $angle-percentage: 0%;
  @if $angle < 46 {
    $angle-percentage: calc(#{$angle} / 45 * 100%);
  }
  @if $angle > 45 {
    $angle-percentage: 0%;
    @error 'Invalid angle, it must be between 1-45';
  }

  @if $angle-position-x == 'left' {
    -webkit-clip-path: polygon(0 0, 100% 0%, 100% $angle-percentage);
    clip-path:  polygon(0 0, 0 , 100% 0%, $angle-percentage);
  }

  @if $angle-position-x == 'right' {
    -webkit-clip-path: polygon(0 0, 0 $angle-percentage, 100% 0);
    clip-path:  polygon(0 0, 0 $angle-percentage, 100% 0);
  }
}

from angled-edges.

NigelOToole avatar NigelOToole commented on May 28, 2024

Hey

I cant seem to replicate the problem, would you be able to put a version up on something like codepen so I can inspect in?

from angled-edges.

AllanPooley avatar AllanPooley commented on May 28, 2024

Hey @NigelOToole, sorry I didn't get back to you until today - we had the Queen's Birthday long weekend in Australia - God Save The Queen! 👸

I'll try spin something up today.

It could be an issue with the way I've applied your mixin.

Rather than clipping an element, I have an optional slant that can be appended onto the end of each block of page content (CMS controlled blocks - Headless WordPress). These optional slants are fixed height polygons.

from angled-edges.

AllanPooley avatar AllanPooley commented on May 28, 2024

@NigelOToole https://codepen.io/allanpooley/full/aKJrRr/

from angled-edges.

NigelOToole avatar NigelOToole commented on May 28, 2024

If you remove border-styles: block; from .slant-block .inner-slant.slant-right-to-left::before, .slant-block .inner-slant.slant-right-to-left::after it seems to fix the issue.

from angled-edges.

AllanPooley avatar AllanPooley commented on May 28, 2024

Right! Would have never have found that. Thanks Nigel

from angled-edges.

andrewjburnett avatar andrewjburnett commented on May 28, 2024

I can't seem to get this to work on Safari either. Any help would be appreciated. Thank you!

from angled-edges.

AllanPooley avatar AllanPooley commented on May 28, 2024

Hey @andrewjburnett, I believe Nigel has provided the fix for my particular issue. His library does work with Safari.

What might be your issue is that this mixin assumes that you'll be using an auto-prefixer in your sass build!

If you are using the sass with your own build configuration & don't want to include autoprefixer try adding -webkit-clip-path to any clip-path declarations.

For example:

-webkit-clip-path: polygon($clip-path-top, $clip-path-bottom);
clip-path: polygon($clip-path-top, $clip-path-bottom);

from angled-edges.

NigelOToole avatar NigelOToole commented on May 28, 2024

Hey @andrewjburnett, did adding the -webkit work for you?

from angled-edges.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.