Version 1
[yaffs-website] / web / core / modules / filter / css / filter.caption.css
diff --git a/web/core/modules/filter/css/filter.caption.css b/web/core/modules/filter/css/filter.caption.css
new file mode 100644 (file)
index 0000000..c436f1b
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ * @file
+ * Caption filter: default styling for displaying image captions.
+ */
+
+/**
+ * Essentials, based on http://stackoverflow.com/a/13363408.
+ */
+.caption {
+  display: table;
+}
+.caption > * {
+  display: block;
+  max-width: 100%;
+}
+.caption > figcaption {
+  display: table-caption;
+  caption-side: bottom;
+  max-width: none;
+}
+
+/**
+ * While editing and whenever the caption is empty, show a placeholder.
+ *
+ * Based on http://codepen.io/flesler/pen/AEIFc.
+ */
+.caption > figcaption[contenteditable=true]:empty:before {
+  content: attr(data-placeholder);
+  font-style: italic;
+}