@carbon/element-styles 0.3.0 → 0.3.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/element-styles",
3
3
  "description": "An experimental styling system for native HTML elements, relying on semantic, attribute-focused selectors instead of class names.",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "sass": "index.scss",
@@ -17,13 +17,16 @@ $config: () !default;
17
17
 
18
18
  $-default-config: (
19
19
  selector: 'a',
20
+ emit-visited: true,
20
21
  );
21
22
 
22
23
  /// @group anchor
23
24
  /// @param {Map} config [()]
24
25
  /// @param {Selector} config.selector ['a']
26
+ /// @param {Bool} config.emit-visited [true] - Enable visited link styles using theme.$link-visited
25
27
  @mixin styles($config: $config) {
26
28
  $props: map.deep-merge($-default-config, $config);
29
+ $emit-visited: map.get($props, 'emit-visited') == true;
27
30
 
28
31
  #{map.get($props, 'selector')} {
29
32
  display: inline-flex;
@@ -33,10 +36,26 @@ $-default-config: (
33
36
  text-decoration: underline;
34
37
  transition: color layout.$mode--transition-duration layout.$mode--transition-timing-function;
35
38
 
39
+ // TODO: remove when fixed firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=868975
40
+ @if $emit-visited {
41
+ @supports (-moz-appearance: none) {
42
+ transition: none;
43
+ }
44
+ }
45
+
36
46
  &:hover {
37
47
  color: theme.$link-primary-hover;
38
48
  }
39
49
 
50
+ @if $emit-visited {
51
+ &:visited {
52
+ color: theme.$link-visited;
53
+ }
54
+ &:visited svg {
55
+ fill: theme.$link-visited;
56
+ }
57
+ }
58
+
40
59
  &:focus {
41
60
  @include focus-outline.focus-outline('outline');
42
61
  }