@ox-content/vite-plugin 3.0.0-alpha.14 → 3.0.0-alpha.16

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.
@@ -1,6 +1,6 @@
1
1
  /* ox-content OGP Card Plugin - Link card styles */
2
2
 
3
- .ox-ogp-card {
3
+ .ox-ogp-card.ox-ogp-card {
4
4
  display: flex;
5
5
  margin: 1.5rem 0;
6
6
  border: 0;
@@ -11,10 +11,11 @@
11
11
  background: transparent;
12
12
  text-decoration: none;
13
13
  color: var(--octc-color-text);
14
+ font-weight: 400;
14
15
  transition: color 0.2s ease;
15
16
  }
16
17
 
17
- .ox-ogp-card:hover {
18
+ .ox-ogp-card.ox-ogp-card:hover {
18
19
  text-decoration: none;
19
20
  }
20
21
 
@@ -61,10 +62,14 @@
61
62
  color: var(--octc-color-text-muted);
62
63
  }
63
64
 
64
- .ox-ogp-favicon {
65
+ .ox-ogp-card .ox-ogp-favicon {
66
+ display: block;
67
+ flex: 0 0 auto;
65
68
  width: 16px;
66
69
  height: 16px;
70
+ margin: 0;
67
71
  border-radius: 2px;
72
+ object-fit: contain;
68
73
  }
69
74
 
70
75
  .ox-ogp-domain {
@@ -73,11 +78,13 @@
73
78
  white-space: nowrap;
74
79
  }
75
80
 
76
- .ox-ogp-image {
81
+ .ox-ogp-card .ox-ogp-image {
82
+ display: block;
77
83
  width: 200px;
78
84
  min-width: 200px;
79
85
  height: auto;
80
- object-fit: cover;
86
+ margin: 0;
87
+ object-fit: contain;
81
88
  background: var(--octc-color-bg-alt);
82
89
  }
83
90
 
@@ -109,7 +116,7 @@
109
116
  flex-direction: column;
110
117
  }
111
118
 
112
- .ox-ogp-image {
119
+ .ox-ogp-card .ox-ogp-image {
113
120
  width: 100%;
114
121
  min-width: 100%;
115
122
  height: 160px;
@@ -1,3 +1,74 @@
1
+ /*
2
+ * Host-prose isolation for full-fidelity Tweet cards.
3
+ *
4
+ * The full card replaces native elements — a `<figure>` root, `<img>`
5
+ * avatars and media, a `<blockquote>` for the quoted post — and an article
6
+ * stylesheet such as `@tailwindcss/typography` styles those by element. The
7
+ * component rules below the isolation block win wherever they set a
8
+ * property; this file covers the properties they never set, which is how a
9
+ * `.prose` article was adding image margins to avatars and quotation
10
+ * typography to the quoted post.
11
+ *
12
+ * Every selector doubles the root class (`.ox-tweet.ox-tweet--full`) so it
13
+ * outranks `.prose <element>` regardless of which stylesheet the host
14
+ * imports last. Generated quotes need a longer chain still: Tailwind writes
15
+ * them at `.prose blockquote p:first-of-type::before`.
16
+ */
17
+
18
+ /*
19
+ * The card root is a `<figure>`, and the component sets its margin at one
20
+ * class of specificity — which `.prose figure` outranks. Restate it here
21
+ * through the same custom property, so a host that overrides the property
22
+ * still gets what it asked for.
23
+ */
24
+ .ox-tweet.ox-tweet--full {
25
+ margin: var(--ox-tweet-container-margin);
26
+ }
27
+
28
+ .ox-tweet.ox-tweet--full :where(img, video, figure, picture, svg) {
29
+ margin: 0;
30
+ }
31
+
32
+ .ox-tweet.ox-tweet--full :where(p, ul, ol, li, dl, dd, dt, hr, h1, h2, h3, h4, h5, h6) {
33
+ margin: 0;
34
+ padding: 0;
35
+ }
36
+
37
+ .ox-tweet.ox-tweet--full :where(ul, ol) {
38
+ list-style: none;
39
+ }
40
+
41
+ .ox-tweet.ox-tweet--full :where(a) {
42
+ font-weight: inherit;
43
+ text-decoration: none;
44
+ }
45
+
46
+ .ox-tweet.ox-tweet--full :where(code, pre, kbd, samp) {
47
+ padding: 0;
48
+ font-size: inherit;
49
+ font-family: inherit;
50
+ background: none;
51
+ }
52
+
53
+ .ox-tweet.ox-tweet--full :where(code)::before,
54
+ .ox-tweet.ox-tweet--full :where(code)::after {
55
+ content: none;
56
+ }
57
+
58
+ /* The quoted post is a `<blockquote>`, which prose styles the hardest. */
59
+ .ox-tweet.ox-tweet--full .ox-tweet__quote {
60
+ font-style: normal;
61
+ font-weight: 400;
62
+ color: inherit;
63
+ quotes: none;
64
+ }
65
+
66
+ .ox-tweet.ox-tweet--full .ox-tweet__quote :where(p)::before,
67
+ .ox-tweet.ox-tweet--full .ox-tweet__quote :where(p)::after,
68
+ .ox-tweet.ox-tweet--full .ox-tweet__quote :where(p):first-of-type::before,
69
+ .ox-tweet.ox-tweet--full .ox-tweet__quote :where(p):last-of-type::after {
70
+ content: none;
71
+ }
1
72
  /*
2
73
  * Opt-in full-card chrome for Twitter/X embeds.
3
74
  * Loaded only when a page has .ox-tweet--full.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/vite-plugin",
3
- "version": "3.0.0-alpha.14",
3
+ "version": "3.0.0-alpha.16",
4
4
  "description": "Vite plugin for Ox Content - High-performance Markdown processing with Environment API",
5
5
  "keywords": [
6
6
  "environment-api",
@@ -109,7 +109,7 @@
109
109
  "satori-html": "^0.3.2",
110
110
  "typescript": "^7.0.2",
111
111
  "unified": "^11.0.5",
112
- "@ox-content/napi": "3.0.0-alpha.14"
112
+ "@ox-content/napi": "3.0.0-alpha.16"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@playwright/test": "^1.62.1",