Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuzanne Selhorn <sselhorn@gitlab.com>2024-01-10 05:23:49 +0300
committerSuzanne Selhorn <sselhorn@gitlab.com>2024-01-10 05:23:49 +0300
commit209f463d05979957aee49523ca89bcba0f2c4a17 (patch)
tree1c232687aaee0d0b021eeecef5a966cb3cd61246
parent73c9a1f64c09679eb3d25033097f630a2411b77f (diff)
Adding alert type for availability
Because maybe we can use this for showing tier badge info
-rw-r--r--content/assets/stylesheets/_variables.scss4
-rw-r--r--content/assets/stylesheets/stylesheet.scss17
-rw-r--r--lib/filters/admonition.rb2
-rw-r--r--lib/helpers/admonition.rb2
4 files changed, 24 insertions, 1 deletions
diff --git a/content/assets/stylesheets/_variables.scss b/content/assets/stylesheets/_variables.scss
index 441557c5..e087f521 100644
--- a/content/assets/stylesheets/_variables.scss
+++ b/content/assets/stylesheets/_variables.scss
@@ -81,6 +81,10 @@ $alert-note-bg: #fafafa;
$alert-note-txt: $gds-black;
$alert-note-border: #dbdbdb;
+$alert-details-bg: $gds-white;
+$alert-details-txt: $gds-black;
+$alert-details-border: #fca326;
+
$alert-info-bg: #f1f1ff;
$alert-info-txt: $gds-black;
$alert-info-border: #dbdbf8;
diff --git a/content/assets/stylesheets/stylesheet.scss b/content/assets/stylesheets/stylesheet.scss
index 65ec26dd..e2ed826e 100644
--- a/content/assets/stylesheets/stylesheet.scss
+++ b/content/assets/stylesheets/stylesheet.scss
@@ -176,6 +176,23 @@ ol {
border-radius: 5px;
}
+.alert-details {
+ font-size: 0.875rem;
+ background-color: $alert-details-bg;
+ color: $alert-details-txt;
+ border: solid 1px $alert-details-border;
+ border-radius: 5px;
+ float: right;
+ width: 35%;
+ margin-left: 25px;
+
+ @media (max-width: $bp-sm) {
+ width: 100%;
+ margin-top: 0.25rem;
+ margin-bottom: 0.25rem;
+ }
+}
+
.alert-warning {
background-color: $alert-warning-bg;
color: $alert-warning-txt;
diff --git a/lib/filters/admonition.rb b/lib/filters/admonition.rb
index d19f97ac..ca8fdb80 100644
--- a/lib/filters/admonition.rb
+++ b/lib/filters/admonition.rb
@@ -10,7 +10,7 @@ class AdmonitionFilter < Nanoc::Filter
doc = Nokogiri::HTML.fragment(content.dup)
doc.css('p').each do |para|
content = para.inner_html
- match = content.match(%r{\A(?<type>NOTE|WARNING|FLAG|INFO|DISCLAIMER):\s?(?<content>.*)\Z}m)
+ match = content.match(%r{\A(?<type>NOTE|DETAILS|WARNING|FLAG|INFO|DISCLAIMER):\s?(?<content>.*)\Z}m)
next unless match
new_content = admonition(match[:type].downcase, match[:content])
diff --git a/lib/helpers/admonition.rb b/lib/helpers/admonition.rb
index e6df0eca..706d92e6 100644
--- a/lib/helpers/admonition.rb
+++ b/lib/helpers/admonition.rb
@@ -4,6 +4,7 @@ module Nanoc::Helpers
module Admonition
BOOTSTRAP_MAPPING = {
'note' => 'note',
+ 'details' => 'details',
'warning' => 'warning',
'flag' => 'flag',
'info' => 'info',
@@ -12,6 +13,7 @@ module Nanoc::Helpers
GITLAB_SVGS_MAPPING = {
'note' => 'information-o',
+ 'details' => 'license',
'warning' => 'warning',
'flag' => 'flag',
'info' => 'tanuki',