You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chaining several preprocessors may lead to errors if the svelte parser and walker is being manipulated multiple time. This issue is due to the way svelte runs its preprocessor in two phases. [Read more here](https://github.com/firefish5000/svelte-as-markup-preprocessor#motivation)
@@ -681,54 +702,36 @@ export default {
681
702
<style module>
682
703
.modal {
683
704
position: fixed;
684
-
top: 50%;
685
-
left: 50%;
686
-
z-index: 10;
687
-
width: 400px;
688
-
height: 80%;
689
-
background-color: #fff;
690
-
transform: translateX(-50%) translateY(-50%);
691
-
}
692
-
section {
693
-
flex: 01auto;
694
-
flex-direction: column;
695
-
display: flex;
696
-
height: 100%;
705
+
...
697
706
}
698
707
header {
699
-
padding: 1rem;
700
-
border-bottom: 1pxsolid#d9d9d9;
708
+
...
701
709
}
702
710
.body {
703
-
padding: 1rem;
704
711
flex: 100;
712
+
...
705
713
}
706
714
footer {
707
-
padding: 1rem;
708
-
border-top: 1pxsolid#d9d9d9;
715
+
...
709
716
}
710
717
button {
711
-
background: #fff;
712
-
border: 1pxsolid#ccc;
713
-
border-radius: 5px;
718
+
...
714
719
}
715
720
.cancel {
716
721
background-color: #f2f2f2;
717
722
}
718
723
</style>
719
724
720
-
<divclass="modal">
721
-
<section>
722
-
<header>My Modal Title</header>
723
-
<divclass="body">
724
-
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p>
725
-
</div>
726
-
<footer>
727
-
<button>Ok</button>
728
-
<buttonclass="cancel">Cancel</button>
729
-
</footer>
730
-
</section>
731
-
</div>
725
+
<sectionclass="modal">
726
+
<header>My Modal Title</header>
727
+
<divclass="body">
728
+
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p>
729
+
</div>
730
+
<footer>
731
+
<button>Ok</button>
732
+
<buttonclass="cancel">Cancel</button>
733
+
</footer>
734
+
</section>
732
735
```
733
736
734
737
***OR** Svelte Component using `import`*
@@ -737,13 +740,7 @@ export default {
737
740
/** style.module.css */
738
741
.modal {
739
742
position: fixed;
740
-
top: 50%;
741
-
left: 50%;
742
-
z-index: 10;
743
-
width: 400px;
744
-
height: 80%;
745
-
background-color: #fff;
746
-
transform: translateX(-50%) translateY(-50%);
743
+
...
747
744
}
748
745
749
746
[...]
@@ -753,18 +750,16 @@ export default {
753
750
import style from './style.module.css';
754
751
</script>
755
752
756
-
<div class={style.modal}>
757
-
<section>
758
-
<header>My Modal Title</header>
759
-
<div class={style.body}>
760
-
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p>
761
-
</div>
762
-
<footer>
763
-
<button>Ok</button>
764
-
<button class={style.cancel}>Cancel</button>
765
-
</footer>
766
-
</section>
767
-
</div>
753
+
<section class={style.modal}>
754
+
<header>My Modal Title</header>
755
+
<div class={style.body}>
756
+
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p>
757
+
</div>
758
+
<footer>
759
+
<button>Ok</button>
760
+
<button class={style.cancel}>Cancel</button>
761
+
</footer>
762
+
</section>
768
763
```
769
764
770
765
*Final htmlcode generated by svelte*
@@ -773,54 +768,36 @@ export default {
773
768
<style>
774
769
._329TyLUs9c {
775
770
position: fixed;
776
-
top: 50%;
777
-
left: 50%;
778
-
z-index: 10;
779
-
width: 400px;
780
-
height: 80%;
781
-
background-color: #fff;
782
-
transform: translateX(-50%) translateY(-50%);
783
-
}
784
-
section {
785
-
flex: 01auto;
786
-
flex-direction: column;
787
-
display: flex;
788
-
height: 100%;
771
+
...
789
772
}
790
773
header {
791
-
padding: 1rem;
792
-
border-bottom: 1pxsolid#d9d9d9;
774
+
...
793
775
}
794
776
._1HPUBXtzNG {
795
-
padding: 1rem;
796
777
flex: 100;
778
+
...
797
779
}
798
780
footer {
799
-
padding: 1rem;
800
-
border-top: 1pxsolid#d9d9d9;
781
+
...
801
782
}
802
783
button {
803
-
background: #fff;
804
-
border: 1pxsolid#ccc;
805
-
border-radius: 5px;
784
+
...
806
785
}
807
786
._1xhJxRwWs7 {
808
787
background-color: #f2f2f2;
809
788
}
810
789
</style>
811
790
812
-
<div class="_329TyLUs9c">
813
-
<section>
814
-
<header>My Modal Title</header>
815
-
<div class="_1HPUBXtzNG">
816
-
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p>
817
-
</div>
818
-
<footer>
819
-
<button>Ok</button>
820
-
<button class="_1xhJxRwWs7">Cancel</button>
821
-
</footer>
822
-
</section>
823
-
</div>
791
+
<section class="_329TyLUs9c">
792
+
<header>My Modal Title</header>
793
+
<div class="_1HPUBXtzNG">
794
+
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p>
0 commit comments