Skip to content

Commit 58039b3

Browse files
authored
Merge pull request #45981 from sftim/20240423_redo_feature_state
Revise appearance for feature-state shortcode
2 parents bfa1214 + f8bd556 commit 58039b3

File tree

3 files changed

+39
-48
lines changed

3 files changed

+39
-48
lines changed

assets/scss/_custom.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,36 @@ body {
514514
h1:first-of-type + .alert.callout {
515515
margin-top: 1.5em;
516516
}
517+
518+
div.feature-state-notice {
519+
background-color: #daeaf9;
520+
border-radius: 0.75rem;
521+
padding: 1rem;
522+
margin-bottom: 1em;
523+
524+
font-size: 1.2em;
525+
526+
> .feature-state-name::before {
527+
content: '';
528+
color: #326ce5; // Kubernetes blue
529+
}
530+
> .feature-state-name {
531+
display: inline-block;
532+
font-size: 0.95em;
533+
font-weight: bold;
534+
color: #000;
535+
background-color: #daeaf9;
536+
}
537+
538+
code {
539+
color: #000;
540+
font-size: 1em;
541+
background-color: #daeaf9;
542+
}
543+
544+
margin-right: 2em;
545+
max-width: 80%;
546+
}
517547
}
518548

519549
// Special color for third party content disclaimers

layouts/shortcodes/feature-state.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
{{ if not $is_valid }}
1010
{{ errorf "%q is not a valid feature-state, use one of %q" $state $valid_states }}
1111
{{ else }}
12-
<div class="my-2 feature-state-notice feature-{{ $state }}">
13-
<b>{{ T "feature_state" }}</b> <code>{{T "feature_state_kubernetes_label" }} {{ $for_k8s_version }} [{{ $state }}]</code>
12+
<div class="feature-state-notice feature-{{ $state }}">
13+
<span class="feature-state-name">{{ T "feature_state" }}</span> <code>{{T "feature_state_kubernetes_label" }} {{ $for_k8s_version }} [{{ $state }}]</code>
1414
</div>
1515
{{ end }}
1616

@@ -31,19 +31,19 @@
3131
<!-- Iterate through feature gate files -->
3232
{{- range $featureGateFile := $sortedFeatureGates -}}
3333
{{- $featureGateNameFromFile := $featureGateFile.Params.Title -}}
34-
34+
3535
{{- if eq $featureGateNameFromFile $feature_gate_name -}}
3636
<!-- Extract information from the final stage of the feature gate -->
3737
{{- $currentStage := index $featureGateFile.Params.stages (sub (len $featureGateFile.Params.stages) 1) -}}
38-
{{- with $currentStage -}}
38+
{{- with $currentStage -}}
3939

4040
<!-- Display feature state information -->
41-
<div class="my-2 feature-state-notice feature-{{ .stage }}" title="{{ printf "%s %s" (T "feature_state_feature_gate_tooltip") $feature_gate_name }}">
42-
<b>{{ T "feature_state" }}</b> <code>{{T "feature_state_kubernetes_label" }} v{{ .fromVersion }} [{{ .stage }}]</code>
43-
</div>
41+
<div class="feature-state-notice feature-{{ .stage }}" title="{{ printf "%s %s" (T "feature_state_feature_gate_tooltip") $feature_gate_name }}">
42+
<span class="feature-state-name">{{ T "feature_state" }}</span> <code>{{T "feature_state_kubernetes_label" }} v{{ .fromVersion }} [{{ .stage }}]</code>
43+
</div>
4444

45-
{{- $featureGateFound = true -}}
46-
{{- end -}}
45+
{{- $featureGateFound = true -}}
46+
{{- end -}}
4747
{{- end -}}
4848
{{- end -}}
4949

static/css/feature-states.css

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)