Comments (9)
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.
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.
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.
@NigelOToole https://codepen.io/allanpooley/full/aKJrRr/
from angled-edges.
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.
Right! Would have never have found that. Thanks Nigel
from angled-edges.
I can't seem to get this to work on Safari either. Any help would be appreciated. Thank you!
from angled-edges.
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.
Hey @andrewjburnett, did adding the -webkit work for you?
from angled-edges.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angled-edges.