11import fs from 'fs'
22import * as path from 'path'
33import postcss from 'postcss'
4+ import { env } from './lib/sharedState'
45import createUtilityPlugin from './util/createUtilityPlugin'
56import buildMediaQuery from './util/buildMediaQuery'
67import escapeClassName from './util/escapeClassName'
@@ -623,6 +624,8 @@ export let corePlugins = {
623624 [ 'inset-y' , [ 'top' , 'bottom' ] ] ,
624625 ] ,
625626 [
627+ [ 'start' , [ 'inset-inline-start' ] ] ,
628+ [ 'end' , [ 'inset-inline-end' ] ] ,
626629 [ 'top' , [ 'top' ] ] ,
627630 [ 'right' , [ 'right' ] ] ,
628631 [ 'bottom' , [ 'bottom' ] ] ,
@@ -674,6 +677,8 @@ export let corePlugins = {
674677 [ 'my' , [ 'margin-top' , 'margin-bottom' ] ] ,
675678 ] ,
676679 [
680+ [ 'ms' , [ 'margin-inline-start' ] ] ,
681+ [ 'me' , [ 'margin-inline-end' ] ] ,
677682 [ 'mt' , [ 'margin-top' ] ] ,
678683 [ 'mr' , [ 'margin-right' ] ] ,
679684 [ 'mb' , [ 'margin-bottom' ] ] ,
@@ -1022,6 +1027,8 @@ export let corePlugins = {
10221027 [ 'scroll-my' , [ 'scroll-margin-top' , 'scroll-margin-bottom' ] ] ,
10231028 ] ,
10241029 [
1030+ [ 'scroll-ms' , [ 'scroll-margin-inline-start' ] ] ,
1031+ [ 'scroll-me' , [ 'scroll-margin-inline-end' ] ] ,
10251032 [ 'scroll-mt' , [ 'scroll-margin-top' ] ] ,
10261033 [ 'scroll-mr' , [ 'scroll-margin-right' ] ] ,
10271034 [ 'scroll-mb' , [ 'scroll-margin-bottom' ] ] ,
@@ -1038,6 +1045,8 @@ export let corePlugins = {
10381045 [ 'scroll-py' , [ 'scroll-padding-top' , 'scroll-padding-bottom' ] ] ,
10391046 ] ,
10401047 [
1048+ [ 'scroll-ps' , [ 'scroll-padding-inline-start' ] ] ,
1049+ [ 'scroll-pe' , [ 'scroll-padding-inline-end' ] ] ,
10411050 [ 'scroll-pt' , [ 'scroll-padding-top' ] ] ,
10421051 [ 'scroll-pr' , [ 'scroll-padding-right' ] ] ,
10431052 [ 'scroll-pb' , [ 'scroll-padding-bottom' ] ] ,
@@ -1211,6 +1220,16 @@ export let corePlugins = {
12111220 'space-x' : ( value ) => {
12121221 value = value === '0' ? '0px' : value
12131222
1223+ if ( env . OXIDE ) {
1224+ return {
1225+ '& > :not([hidden]) ~ :not([hidden])' : {
1226+ '--tw-space-x-reverse' : '0' ,
1227+ 'margin-inline-end' : `calc(${ value } * var(--tw-space-x-reverse))` ,
1228+ 'margin-inline-start' : `calc(${ value } * calc(1 - var(--tw-space-x-reverse)))` ,
1229+ } ,
1230+ }
1231+ }
1232+
12141233 return {
12151234 '& > :not([hidden]) ~ :not([hidden])' : {
12161235 '--tw-space-x-reverse' : '0' ,
@@ -1246,6 +1265,17 @@ export let corePlugins = {
12461265 'divide-x' : ( value ) => {
12471266 value = value === '0' ? '0px' : value
12481267
1268+ if ( env . OXIDE ) {
1269+ return {
1270+ '& > :not([hidden]) ~ :not([hidden])' : {
1271+ '@defaults border-width' : { } ,
1272+ '--tw-divide-x-reverse' : '0' ,
1273+ 'border-inline-end-width' : `calc(${ value } * var(--tw-divide-x-reverse))` ,
1274+ 'border-inline-start-width' : `calc(${ value } * calc(1 - var(--tw-divide-x-reverse)))` ,
1275+ } ,
1276+ }
1277+ }
1278+
12491279 return {
12501280 '& > :not([hidden]) ~ :not([hidden])' : {
12511281 '@defaults border-width' : { } ,
@@ -1435,12 +1465,18 @@ export let corePlugins = {
14351465 borderRadius : createUtilityPlugin ( 'borderRadius' , [
14361466 [ 'rounded' , [ 'border-radius' ] ] ,
14371467 [
1468+ [ 'rounded-s' , [ 'border-start-start-radius' , 'border-end-start-radius' ] ] ,
1469+ [ 'rounded-e' , [ 'border-start-end-radius' , 'border-end-end-radius' ] ] ,
14381470 [ 'rounded-t' , [ 'border-top-left-radius' , 'border-top-right-radius' ] ] ,
14391471 [ 'rounded-r' , [ 'border-top-right-radius' , 'border-bottom-right-radius' ] ] ,
14401472 [ 'rounded-b' , [ 'border-bottom-right-radius' , 'border-bottom-left-radius' ] ] ,
14411473 [ 'rounded-l' , [ 'border-top-left-radius' , 'border-bottom-left-radius' ] ] ,
14421474 ] ,
14431475 [
1476+ [ 'rounded-ss' , [ 'border-start-start-radius' ] ] ,
1477+ [ 'rounded-se' , [ 'border-start-end-radius' ] ] ,
1478+ [ 'rounded-ee' , [ 'border-end-end-radius' ] ] ,
1479+ [ 'rounded-es' , [ 'border-end-start-radius' ] ] ,
14441480 [ 'rounded-tl' , [ 'border-top-left-radius' ] ] ,
14451481 [ 'rounded-tr' , [ 'border-top-right-radius' ] ] ,
14461482 [ 'rounded-br' , [ 'border-bottom-right-radius' ] ] ,
@@ -1457,6 +1493,8 @@ export let corePlugins = {
14571493 [ 'border-y' , [ [ '@defaults border-width' , { } ] , 'border-top-width' , 'border-bottom-width' ] ] ,
14581494 ] ,
14591495 [
1496+ [ 'border-s' , [ [ '@defaults border-width' , { } ] , 'border-inline-start-width' ] ] ,
1497+ [ 'border-e' , [ [ '@defaults border-width' , { } ] , 'border-inline-end-width' ] ] ,
14601498 [ 'border-t' , [ [ '@defaults border-width' , { } ] , 'border-top-width' ] ] ,
14611499 [ 'border-r' , [ [ '@defaults border-width' , { } ] , 'border-right-width' ] ] ,
14621500 [ 'border-b' , [ [ '@defaults border-width' , { } ] , 'border-bottom-width' ] ] ,
@@ -1539,6 +1577,32 @@ export let corePlugins = {
15391577
15401578 matchUtilities (
15411579 {
1580+ 'border-s' : ( value ) => {
1581+ if ( ! corePlugins ( 'borderOpacity' ) ) {
1582+ return {
1583+ 'border-inline-start-color' : toColorValue ( value ) ,
1584+ }
1585+ }
1586+
1587+ return withAlphaVariable ( {
1588+ color : value ,
1589+ property : 'border-inline-start-color' ,
1590+ variable : '--tw-border-opacity' ,
1591+ } )
1592+ } ,
1593+ 'border-e' : ( value ) => {
1594+ if ( ! corePlugins ( 'borderOpacity' ) ) {
1595+ return {
1596+ 'border-inline-end-color' : toColorValue ( value ) ,
1597+ }
1598+ }
1599+
1600+ return withAlphaVariable ( {
1601+ color : value ,
1602+ property : 'border-inline-end-color' ,
1603+ variable : '--tw-border-opacity' ,
1604+ } )
1605+ } ,
15421606 'border-t' : ( value ) => {
15431607 if ( ! corePlugins ( 'borderOpacity' ) ) {
15441608 return {
@@ -1775,6 +1839,8 @@ export let corePlugins = {
17751839 [ 'py' , [ 'padding-top' , 'padding-bottom' ] ] ,
17761840 ] ,
17771841 [
1842+ [ 'ps' , [ 'padding-inline-start' ] ] ,
1843+ [ 'pe' , [ 'padding-inline-end' ] ] ,
17781844 [ 'pt' , [ 'padding-top' ] ] ,
17791845 [ 'pr' , [ 'padding-right' ] ] ,
17801846 [ 'pb' , [ 'padding-bottom' ] ] ,
0 commit comments