@rogieking/figui3 3.21.1 → 3.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components.css CHANGED
@@ -368,7 +368,7 @@
368
368
  inset 0px 0.75px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.1));
369
369
 
370
370
  --handle-shadow:
371
- 0px 0px 0px 0.5px rgba(0, 0, 0, 0.1),
371
+ 0px 0px 0px 1px rgba(0, 0, 0, 0.2),
372
372
  0px 0px 0.5px 0px light-dark(rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.1)),
373
373
  0px 1px 3px 0px light-dark(rgba(0, 0, 0, 0.15), transparent);
374
374
  }
@@ -1873,13 +1873,17 @@ fig-origin-grid {
1873
1873
 
1874
1874
  /* Switch */
1875
1875
  input[type="checkbox"].switch {
1876
+ --knob-width: 0.75rem;
1877
+ --knob-height: 0.5rem;
1878
+ --width: 2rem;
1879
+ --height: 1rem;
1876
1880
  contain: strict;
1877
1881
  display: inline-flex;
1878
1882
  margin: 0;
1879
1883
  vertical-align: middle;
1880
1884
  padding: 0;
1881
- width: 2rem;
1882
- height: 1rem;
1885
+ width: var(--width);
1886
+ height: var(--height);
1883
1887
  left: 0;
1884
1888
  top: 0;
1885
1889
  background: transparent;
@@ -1895,22 +1899,26 @@ input[type="checkbox"].switch {
1895
1899
  transition: var(--input-transition);
1896
1900
  box-sizing: border-box;
1897
1901
  box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
1898
- }
1899
-
1900
- input[type="checkbox"].switch:after {
1901
- content: "";
1902
- background-color: var(--handle-color);
1903
- width: calc(1rem - 2px);
1904
- height: calc(1rem - 2px);
1905
- border-radius: 0.5rem;
1906
- margin: 1px;
1907
- transform: translate(calc(-0.5rem));
1908
- transition: var(--input-transition);
1909
- box-shadow: var(--handle-shadow);
1902
+ &:after {
1903
+ content: "";
1904
+ background-color: var(--handle-color);
1905
+ width: var(--knob-width);
1906
+ height: var(--knob-height);
1907
+ border-radius: 0.5rem;
1908
+ margin: 0.25rem;
1909
+ transform: translate(
1910
+ calc(
1911
+ (var(--width) - var(--knob-width)) * -0.5 +
1912
+ (var(--height) - var(--knob-height)) * 0.5
1913
+ )
1914
+ );
1915
+ transition: var(--input-transition);
1916
+ box-shadow: var(--handle-shadow);
1917
+ }
1910
1918
  }
1911
1919
 
1912
1920
  input[type="checkbox"].switch[indeterminate="true"]:after {
1913
- width: 0.5rem;
1921
+ width: 0.625rem;
1914
1922
  height: 0.125rem;
1915
1923
  transform: none;
1916
1924
  }
@@ -1921,14 +1929,29 @@ input[type="checkbox"].switch:checked {
1921
1929
  }
1922
1930
 
1923
1931
  input[type="checkbox"].switch:checked:after {
1924
- transform: translate(0.5rem);
1932
+ transform: translate(
1933
+ calc(
1934
+ (var(--width) - var(--knob-width)) * 0.5 +
1935
+ (var(--height) - var(--knob-height)) * -0.5
1936
+ )
1937
+ );
1925
1938
  }
1926
1939
 
1927
1940
  input[type="checkbox"].switch:disabled {
1928
- background-color: var(--figma-color-bg-secondary);
1941
+ background-color: transparent;
1929
1942
  cursor: not-allowed;
1930
1943
  &:after {
1931
- background-color: var(--figma-color-bg);
1944
+ background-color: var(--figma-color-icon-disabled);
1945
+ box-shadow: none;
1946
+ }
1947
+
1948
+ &:checked,
1949
+ &[indeterminate="true"] {
1950
+ background-color: var(--figma-color-bg-disabled);
1951
+ box-shadow: none;
1952
+ &:after {
1953
+ background-color: var(--figma-color-bg);
1954
+ }
1932
1955
  }
1933
1956
  }
1934
1957
 
@@ -2797,6 +2820,7 @@ fig-tooltip {
2797
2820
  filter: drop-shadow(0px 1px 1.5px rgba(0, 0, 0, 0.1))
2798
2821
  drop-shadow(0px 2.5px 6px rgba(0, 0, 0, 0.13))
2799
2822
  drop-shadow(0px 0px 0.5px rgba(0, 0, 0, 0.15));
2823
+ pointer-events: none;
2800
2824
 
2801
2825
  & > span {
2802
2826
  text-wrap: balance;
@@ -4911,6 +4935,7 @@ fig-handle {
4911
4935
  place-self: center;
4912
4936
  grid-area: 1 / 1;
4913
4937
  z-index: 2;
4938
+ display: none;
4914
4939
  }
4915
4940
 
4916
4941
  &[size="small"] {
@@ -4933,6 +4958,11 @@ fig-handle {
4933
4958
  pointer-events: none;
4934
4959
  cursor: default;
4935
4960
  }
4961
+ &[type="color"] {
4962
+ &::after {
4963
+ display: block;
4964
+ }
4965
+ }
4936
4966
 
4937
4967
  &[type="color"],
4938
4968
  &[control] {